1. HTTP
(Hypertext Transfer Protocol) is an applicaion-layer protocol for transmitting hypermedia documents such as HTML.
2. HTTP Headers
3. HTTP Request Methods
1) GET: Requests using Get only retrieve data.
2) POST: used to submit an entity to the specified resource
3) DELETE: deletes the specified resource
4) PATCH: apply partial modifications to a resource
etc...
1) Start Line:
HTTP Method/ Reuest target/ HTTP Version
ex) POST/login HTTP/l.1
Headers: (additional info:meta data)
2) Host-> target adress
User-Agent-> client info
Content-Type-> body type
Content-Length-> body length
Authorization-> ex)login token
3) Body:
ex) Body: {
"user_password":'jenna8447"
}
ex)
fetch("http://10.58.2.116:8003/product", {
method: "POST",
headers: {
Authorization: localStorage.getItem("access_token"),
},
body: formData,
})
4. HTTP Status Responses Codes
1) 200: OK
2) 201: Created
3) 400: Bad Request
4) 401: Unauthorized
5) 403: Forbidden
6) 404: Not Found
7) 500: Internal Server Error