lanmind Posted September 5, 2009 Report Share Posted September 5, 2009 (edited) 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. Edited September 5, 2009 by lanmind Link to comment Share on other sites More sharing options...
Ingolme Posted September 5, 2009 Report 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 Report Share Posted September 5, 2009 I see, thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now