Jump to content

Using Post With Ajax Questions


lanmind

Recommended Posts

Hello everybody,If anybody can help explain my questions I'd appreciate it. When you use a POST request versus a GET requset with Ajax how come:One- Some http headers must be sent along with any POST request? Like so:

http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");http.setRequestHeader("Content-length", params.length);http.setRequestHeader("Connection", "close");

Two- The data to be sent must be sent as the argument of the send function? Like so:

http.send(params);

I'm really clueless why headers must be sent on a POST versus a GET requset.Thank you for your time.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...