XML AJAXLesson 23Free preview
AJAX Request
This lesson is part of XML · All levels
Summary
After the open() is called, the request is actually sent by the send() method. For GET requests, data is usually included in the URL, while for POST data is sent via the request body. When sending certain data, the Content-Type header such as application/x-www-form-urlencoded needs to be set to setRequestHeader().
Key points
- Execute a pre-defined request
- GET transmits the parameters through the URL, POST through the body
- The flag makes the request run asynchronous
- SetRequestHeader() set the header as Content-Type
- General form data is sent via the POST method
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.