HTTP & Async Flashcards
The HTTP Acronymn stands for what?
HyperText Transfer Protocol
(designed to retreive information)
What is HTTP?
It’s a “message” that you are sending to a server.
Every HTTP “message” is called what?
Every HTTP “message” is called a
REQUEST
Every HTTP “reply” is called what?
Every HTTP “reply” is called a RESPONSE
The Anatomy of an HTTP request contains?
URL: https://google.com/apis/test
Method: GET, POST, PUT, PATCH, DELETE…
Headers: Authentication, cookies, Content-Type
Payload: data or empty
What is the endpoint address we’re reaching out for and it starts with HTTP or HTTPS?
URL
Uniform Resource Locator
What tells the endpoint the purpose of our request?
Method
The most commonly used HTTP methods in modern API’s are:
GET: I want some information
POST: I’m sending some information
PUT: I want to edit something
DELETE: I want to delete something
What specifies some extra information about our Request?
Headers
eg:
- Content-Type:* I’m sending data in JSON format
- Authorization:* This is my key to authorize me
- Accept:* I expect to receive back some JSON data
- Cookie* Want some cookie?
What is sent only on POST (create) and PUT (edit ) request and is also known as the body of the request?
Payload
What is the 3 digit integer which indicates whether a request has been gone successfully or not?
Status Code
A 201 HTTP status code stands for what?
Status Code: 201 means:
Created
tells us the result of the operation
A 500 HTTP status code stands for what?
Status Code: 500 means:
INTERNAL SERVER ERROR
something wrong, server side
A 404 HTTP status code stands for what?
Status Code: 404 means:
NOT FOUND
cannot find the info you’re looking for
A 401 HTTP status code stands for what?
Status Code: 401 means:
UNAUTHORIZED
you are not authorized