lanmind Posted September 5, 2009 Share Posted September 5, 2009 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 More sharing options...
Ingolme Posted September 5, 2009 Share Posted September 5, 2009 You need to send headers as long as you're sending data. When using GET, you don't send any data because the data can be extracted from the URL. Link to comment Share on other sites More sharing options...
lanmind Posted September 5, 2009 Author Share Posted September 5, 2009 I see, thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.