Skip to content

Commit 95eef73

Browse files
committed
docs: add rest api examples
1 parent 6f33166 commit 95eef73

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

README.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,81 @@
22

33
A Reverse Proxy that serves HTTP endpoints for gRPC Server https://github.com/subbuv26/image-array-grpc
44

5+
# REST API
6+
7+
## Get List of Images
8+
9+
### Request
10+
GET localhost:8080/images
11+
12+
### Repsonse
13+
< HTTP/2 200
14+
< content-type: application/json
15+
< content-length: 116
16+
< apigw-requestid: BjYDVgoOBcwEMTg=
17+
< grpc-metadata-content-type: application/grpc
18+
19+
{
20+
"Images": [
21+
{
22+
"url": "image.png",
23+
"name": "profile",
24+
"size": 1000
25+
},
26+
{
27+
"url": "image2.png",
28+
"name": "profile",
29+
"size": 2000
30+
}
31+
]
32+
}
33+
34+
## Get an Image
35+
### Request
36+
GET localhost:8080/images/f2a5e510-ef20-4d60-a68f-b50baffdfae6
37+
### Repsonse
38+
< HTTP/2 200
39+
< content-type: application/json
40+
< content-length: 116
41+
< apigw-requestid: BjYDVgoOBcwEMTg=
42+
< grpc-metadata-content-type: application/grpc
43+
44+
{
45+
"url": "image2.png",
46+
"name": "profile",
47+
"size": 2000
48+
}
49+
50+
## Create an Image
51+
### Request
52+
POST localhost:8080/images/
53+
### Body
54+
{
55+
"url": "image2.png",
56+
"name": "profile",
57+
"size": 2000
58+
}
59+
### Response
60+
< HTTP/2 200
61+
< content-type: application/json
62+
< content-length: 116
63+
< apigw-requestid: BjYDVgoOBcwEMTg=
64+
< grpc-metadata-content-type: application/grpc
65+
66+
{
67+
"id": "f2a5e510-ef20-4d60-a68f-b50baffdfae6"
68+
}
69+
70+
## Delete an Image
71+
### Request
72+
DELETE localhost:8080/images/f2a5e510-ef20-4d60-a68f-b50baffdfae6
73+
### Repsonse
74+
< HTTP/2 200
75+
< content-type: application/json
76+
< content-length: 116
77+
< apigw-requestid: BjYDVgoOBcwEMTg=
78+
< grpc-metadata-content-type: application/grpc
79+
80+
{
81+
"success": true
82+
}

0 commit comments

Comments
 (0)