Jump to content

Using Post With Ajax Questions


lanmind
 Share

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.

Edited by lanmind
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...