sync-request-curl
Advanced tools
Comparing version 1.5.5 to 1.5.6
@@ -7,3 +7,3 @@ { | ||
}, | ||
"version": "1.5.5", | ||
"version": "1.5.6", | ||
"files": [ | ||
@@ -10,0 +10,0 @@ "dist" |
@@ -58,2 +58,4 @@ # sync-request-curl | ||
<br/> | ||
`GET` request without options | ||
@@ -64,5 +66,8 @@ | ||
const response = request('GET', 'https://comp1531namesages.alwaysdata.net'); | ||
console.log('Status Code:', response.statusCode); | ||
const jsonBody = JSON.parse(response.body.toString()); | ||
const res = request( | ||
'GET', | ||
'https://comp1531namesages.alwaysdata.net' | ||
); | ||
console.log('Status Code:', res.statusCode); | ||
const jsonBody = JSON.parse(res.body.toString()); | ||
console.log('Returned JSON object:', jsonBody); | ||
@@ -76,3 +81,3 @@ ``` | ||
const response = request( | ||
const res = request( | ||
'GET', | ||
@@ -84,4 +89,4 @@ 'https://comp1531forum.alwaysdata.net/echo/echo', | ||
); | ||
console.log('Status Code:', response.statusCode); | ||
const jsonBody = JSON.parse(response.body.toString()); | ||
console.log('Status Code:', res.statusCode); | ||
const jsonBody = JSON.parse(res.body.toString()); | ||
console.log('Returned JSON object:', jsonBody); | ||
@@ -95,3 +100,3 @@ ``` | ||
const response = request( | ||
const res = request( | ||
'POST', | ||
@@ -107,6 +112,5 @@ 'https://comp1531quiz.alwaysdata.net/quiz/create', | ||
); | ||
console.log('Status Code:', response.statusCode); | ||
const jsonBody = JSON.parse(response.body.toString()); | ||
console.log('Status Code:', res.statusCode); | ||
const jsonBody = JSON.parse(res.body.toString()); | ||
console.log('Returned JSON Object:', jsonBody); | ||
``` | ||
@@ -125,3 +129,3 @@ | ||
HTTP method (of type `HttpVerb`) | ||
- e.g. `PUT`/`POST`/`GET`/`DELETE`. | ||
- e.g. `PUT`/`POST`/`GET`/`DELETE` | ||
@@ -247,3 +251,3 @@ ### 2.2. URL | ||
opt.URL, | ||
'http://0' | ||
'www.ck' | ||
); | ||
@@ -305,7 +309,7 @@ }; | ||
<details closed> | ||
<summary>Massachusetts Institute of Technology (<a href="https://opensource.org/license/mit" target="_blank">MIT</a>)</summary> | ||
<br/> | ||
<details closed> | ||
<summary><a href="https://opensource.org/license/mit" target="_blank">MIT</a></summary> | ||
``` | ||
@@ -335,2 +339,4 @@ Copyright (c) 2023 Khiet Tam Nguyen | ||
<br/> | ||
## 4. Windows/MacOS | ||
@@ -366,2 +372,2 @@ | ||
It has been tested to be working on Arch & Debian Linux and is compatible with Windows/MacOS | ||
It has been tested to be working on Arch & Debian Linux and is compatible with Windows/MacOS. |
41349
363