Hello people,
It’s my first post here. Can you help show me how I can send post request to this API body below with raw PHP? I’m only having a challenge in the “questions” sub-array. There, fetching questions from database using a while loop and sending those data in that sub-array. I’m able to send data to other part of the API body.
`{
“id”:”1222″,
“quizName”:”Mid Term quiz”,
“numberOfQuestions”:”1″,
“isTimed”:false,
“numberOfMinutesToComplete”:”30″,
“targetedClass”: “Js 3”,
“subject”:”Basic Studies”,
“schoolLevel”:”Secondary School”,
“questions”:[
{
“question”:”What is Algebra”,
“questionMark”:”10″,
“options”:[
{
“option”:”A”,
“answer”:”is Good”
},
{
“option”:”B”,
“answer”:”God is good”
},
{
“option”:”C”,
“answer”:”Nigeria is My Country”
}
],
“hasImage”:true,
“images”:[
“images-1”,
“images-2”
],
“correctionOption”:”A”
},
{
“question”:”When Did Nigeria gain here independence”,
“questionMark”:”10″,
“options”:[
{
“option”:”A”,
“answer”:”2000″
},
{
“option”:”B”,
“answer”:”1980″
},
{
“option”:”C”,
“answer”:”1960″
}
],
“hasImage”:true,
“images”:[
“images-1”,
“images-2”
],
“correctionOption”:”A”
},
{
“question”:”Who Designed the nigeria flag”,
“questionMark”:”10″,
“options”:[
{
“option”:”A”,
“answer”:”Charles Onuorah”
},
{
“option”:”B”,
“answer”:”Godluck Jonathan”
},
{
“option”:”C”,
“answer”:”I don’t know”
}
],
“hasImage”:true,
“images”:[
“images-1”,
“images-2”
],
“correctionOption”:”C”
}
],
“totalValidMarks”:”10″,
“validUntil”:”2020-08-10″
}