HTTPrequests
Method, URL, Headers, Body
What'sinanHTTPrequest?
URL
Method
Body
Headers
AURL,amethod,abodyandheaders
URL
TheURLiscomposedofascheme,adomain,apathand(optional)parameters
https://developer.mozilla.org/en-US/search?q=URL+parameter
Scheme Domain Path Parameters
Method
Commonmethods
Themethod(orverb)istheactionyouwanttoperform
• GET= Iwanttoreadsomething
• POST=Iwanttocreatesomething
• PATCH=Iwanttoupdatesomething
• DELETE= Iwanttodeletesomething
Headers
What'sintheheaders
• Authorizationparameters:telltheserverwhoyouareandgivetheright
"password"
• Content-type:telltheserverwhatformat/typeofdatayouaresending
them
Headersandbodyareusedtosenddatatotheserver
Body
What'sinthebody
• Nobodywhenyouaremaking GET requests
• Bodyfora POST or PATCH request(contenttoupdate/create)
• Inmostcases,thiswillbeaJSON
Headersandbodyareusedtosenddatatotheserver