HTTP - GradedJestRisk/web-training GitHub Wiki

API best practice (FR)

Table of Contents

HTTP Versions

List:

  • 1
  • 2
  • 3

Request

verb

case-sensitive

CRUD list:

  • create PUT
  • read GET
  • update POST
  • delete DELETE

header

case-INsensitive

List:

  • browser: User-Agent ie User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0'
  • data : Accept ie Accept: application/json, text/plain, */*'
  • language Accept-Language ie Accept-Language: en-US,en;q=0.5' --compressed
  • origin Origin
  • mode: Connection , ie 'Connection: keep-alive'
  • Location:

body

Response

status code

Reference (MSDN)

success

Code Description
200 OK - Usual case
201, 202, 204, 206 OK - Special cases

error

client

Code Description
400 Generic
401, 403, 404, 405, 406 Specific case

server

Code Description
500 Generic

location

Standards

⚠️ **GitHub.com Fallback** ⚠️