Inthis option 4 is xhhtp.send(JSON.stringify(mobj)) which is not a correct option. Pls give me clarity
Correct answer is option 4 only.
The JSON.stringify(mObj)
method converts the JavaScript object (mObj
) into a JSON string before sending it as the request body. This ensures that the data is properly formatted and can be processed correctly by the server.
1 Like