-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttp_basics
More file actions
50 lines (35 loc) · 1.18 KB
/
http_basics
File metadata and controls
50 lines (35 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
A basic http request consists of:
A verb (or method)
Has a meaning
Is idempotent or not
Is safe or not
Is cachable or not
A resource (or endpoint)
Understanding the common HTTP verbs:
GET: As the name suggests, read from a resource
Retrieve a specific resource from the server, or a list of resources
POST: Creates a resource or trigger a data handling process
Create a new resource on the Server
PUT: Fully updates/replaces an existing resource or create a resource
Update a Resource on ther Server, providing the entire resource
PATCH: Partially updates a resource
Update a resource on the Server, providing only changed attributes.
DELETE: Delete a resource
Remove a Resource from Server
RPC (remote procedure call):
Endpoint contains the name of operations you want to invoke
Generally only uses GET and POST HTTP verbs
GET /someoperation?data=anId
POST /anotheroperation
{
'data': 'anId',
'anotherdata': 'another value'
}
REST
Expose data as resource.
Get /someresource/anId
PUT /someresource/anId
{
"anotherdata": 'another value'
}
REST approach is data based, RPC approach is operation based.