Closed Techdemo closed 6 years ago
Nice! 💪
P.S., do you remember the github prereq?
Take some time to set up your GitHub profile. Include your name, a profile picture, and a URL to your homepage. You’re allowed to stay anonymous online for this course by omitting sensitive information, but a good looking GitHub profile can help you get an internship or job later.
HTTP Cheatsheet
Curl localhost:[url] —verbose : shows information about the request/returns of the server
request OPTIONS : Returns all method options
The request head starts with a “request line”, in this case: GET / HTTP/1.1 Where the first word is the HTTP method (GET), then comes the path requested from the server (/), and finally the protocol (HTTP) and version (1.1).
HTTP Methods
Options
The options method shows all the available methods for the requested URL. When you send the request, the server’s respons are the possible methods.
GET
The get method gets data from a provided URL
HEAD
Basically the same as GET, but tells the server not to send any data back.
POST
Is used to add something to a resource
PUT
PUT is used to place a resource somewhere, whether it exists already or not.
PATCH
The patch method can be used to update some partials of a resource
DELETE
Delete things
Status codes
Status codes in the range of 4xx mean that the client made an error 200 means its OK. I didn’t bothered to learn all the statuscode because I can easily find them in a list somewhere. There are a lot of statuscodes, you can find them here Some statuscodes I stumbled upon doing this assignment