Skip to content

Instantly share code, notes, and snippets.

@ldong
Created June 10, 2014 16:36
Show Gist options
  • Save ldong/2b9275d87bb2cc59a944 to your computer and use it in GitHub Desktop.
Save ldong/2b9275d87bb2cc59a944 to your computer and use it in GitHub Desktop.
Tech talk of restful api

Tech Talk

Restful API

URL/api/ids

GET
PUT
PATCH
DELETE
POST

CRUD

CREATE: POST -> /rcpt/id/

READ: GET -> /rcpt/id/

UPDATE: PUT/PATCH -> /rcpt/id/

DELETE: DELETE -> /rcpt/id/

i.e.

Request:
	GET / HTTP/1.1
	Authorization: dv long key
Response:
	HTTP Status Code:
		100            Continue
		200            OK
		301, 302, 303  Redirects
		400            Invalid
		401, 402, 403
		404            Not Found
		500            Server ERROR

More HTTP status code

Entity tags

Response: Etag: _____

Req: if-None-Match: ____, ____

200 <= 
304 <=

if-Match: ____, ____

HTTP Status Code

Ranges

Req:

Range: bytes=4096-8000 or 4096-]

Resp:

Accept-Range: bytes

Request for header only, using HEAD

HEAD /list/
Accept-Range: list

GET /list/
Range: list=1-10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment