URL vs URI
- URL is a type of URI
https://search.duckduckgo.com:80/settings/user/?q=apples&ia=news#asdf
https://
- protocol
- other protocols: ws://, file://, tcp://, http://, https://,
search.duckduckgo.com/
- server address (Domain)
- search is the subdomain
- duckduckgo is the TLD
/settings/user/
- path
?q=apples&ia=news
- query
- follows ?...
- key-value format
- seperated by &
- more info to the server
#asdf
- anchor
- where on the page to focus
:8080
- port number
- like the path, more specific part of server
- default === :80
HTTP Status Codes
- 200 ok!
- 400 client error
- 500 server error
- 100 info
- 300 redirects
HTTP verbs
- POST and GET
- other: PUT, DELETE, OPTIONS, etc.
GET - get information
- by default, url input makes a get request
- nothing in the body
- sends info through URL -through query, anchor...
POST - usually to create info (talk more later)
- information in the body
Important headers -
- Content-Type
- location (domain)
- Status Code (Response)
- HTTP Verb (Request)
- Protocol
- Cookies