Skip to content

Commit f2fba8b

Browse files
http-request
1 parent b9c0943 commit f2fba8b

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

http-request/.http

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Variables
2+
@baseURL = http://localhost:8080
3+
@devURL = http://localhost:8080
4+
@prodURL = https://web-rest-server-nodejs.herokuapp.com
5+
@queryParams = q=something&name=Elis+Antonio&age=30
6+
7+
### Post
8+
POST https://web-rest-server-nodejs.herokuapp.com/api/users HTTP/1.1
9+
Content-Type: application/json
10+
11+
{
12+
"name": "John Doe",
13+
"email": "johndoe@johndoemail.com"
14+
}
15+
16+
#### Get
17+
GET {{prodURL}}/api/users?{{queryParams}} HTTP/1.1
18+
19+
### Put
20+
PUT {{prodURL}}/api/users/105 HTTP/1.1
21+
22+
### Patch
23+
PATCH {{prodURL}}/ HTTP/1.1
24+
25+
### Delete
26+
DELETE {{prodURL}}/ HTTP/1.1
27+
28+
### Get with environment variable (.env)
29+
GET {{$dotenv PROD_URL}}/ HTTP/1.1

http-request/README.md

Whitespace-only changes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
HTTP/1.1 200 OK
2+
Server: Cowboy
3+
Connection: close
4+
X-Powered-By: Express
5+
Access-Control-Allow-Origin: *
6+
Content-Type: application/json; charset=utf-8
7+
Content-Length: 92
8+
Etag: W/"5c-0uazLUgawm3yGZMFumvnOqOj3Bc"
9+
Date: Fri, 10 Jun 2022 00:07:12 GMT
10+
Via: 1.1 vegur
11+
12+
{"msg":"post API - Controller","data":{"name":"John Doe","email":"johndoe@johndoemail.com"}}

0 commit comments

Comments
 (0)