Jump to content

Using Post With Ajax Questions

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:


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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...