Answer the question
In order to leave comments, you need to log in
How does XMLHttpRequest pass data?
I accidentally forgot to change the request type from 'GET' to 'POST', but the data was successfully sent to the server!
var xhr = new XMLHttpRequest();
xhr.open("GET", url);
xhr.setRequestHeader('Content-type', 'application/json');
xhr.send('{"name":"' + name + '","age":"' + age + '"}');
Answer the question
In order to leave comments, you need to log in
There is a difference between a get and a post.
The fact that you got the correct answer is a backend error on the one hand and luck on the other, because you transferred little data. Try getom "send" a hundred megs
1. Has. Both in terms of the volume of the transmitted request, and in any REST.
2. Can be manually{"a":"b"}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question