36
HTTP Requests in Javascript Stephanie Marx

Javascript HTTP Requests

Embed Size (px)

Citation preview

HTTP Requests in Javascript

Stephanie Marx

Constructor initializes an XMLHttpRequest

Constructor initializes an XMLHttpRequest

We open the request...

Constructor initializes an XMLHttpRequest

We open the request...

send it...

Constructor initializes an XMLHttpRequest

We open the request...

send it...

...and get something back!

method of request

method of requestPOST

GET

PUT

DELETE

method of requestPOST CREATE

GET READ

PUT UPDATE

DELETE DELETE

method of request

method of request URL

method of request URL Should we do this asynchronously?

method of request URL Should we do this asynchronously?

true Notification of completed transaction is provided with event listeners

false send() method doesn’t return until the response is received

method of request URL Should we do this asynchronously?

name of the header

name of the header value to set as body

name of the header value to set as body

name of the header value to set as body

text/plain

text/html

application/json

request body

request body

GET null

POST

request body