|
@@ -32,20 +32,23 @@ It can also be multiple lines long.
|
|
|
> Example request:
|
|
|
|
|
|
```bash
|
|
|
-curl -X GET -G "http://localhost/api/withDescription" \
|
|
|
+curl -X GET \
|
|
|
+ -G "http://localhost/api/withDescription" \
|
|
|
-H "Authorization: customAuthToken" \
|
|
|
-H "Custom-Header: NotSoCustom"
|
|
|
```
|
|
|
|
|
|
```javascript
|
|
|
-const url = new URL("http://localhost/api/withDescription");
|
|
|
+const url = new URL(
|
|
|
+ "http://localhost/api/withDescription"
|
|
|
+);
|
|
|
|
|
|
let headers = {
|
|
|
"Authorization": "customAuthToken",
|
|
|
"Custom-Header": "NotSoCustom",
|
|
|
"Accept": "application/json",
|
|
|
"Content-Type": "application/json",
|
|
|
-}
|
|
|
+};
|
|
|
|
|
|
fetch(url, {
|
|
|
method: "GET",
|
|
@@ -73,20 +76,23 @@ null
|
|
|
> Example request:
|
|
|
|
|
|
```bash
|
|
|
-curl -X GET -G "http://localhost/api/withResponseTag" \
|
|
|
+curl -X GET \
|
|
|
+ -G "http://localhost/api/withResponseTag" \
|
|
|
-H "Authorization: customAuthToken" \
|
|
|
-H "Custom-Header: NotSoCustom"
|
|
|
```
|
|
|
|
|
|
```javascript
|
|
|
-const url = new URL("http://localhost/api/withResponseTag");
|
|
|
+const url = new URL(
|
|
|
+ "http://localhost/api/withResponseTag"
|
|
|
+);
|
|
|
|
|
|
let headers = {
|
|
|
"Authorization": "customAuthToken",
|
|
|
"Custom-Header": "NotSoCustom",
|
|
|
"Accept": "application/json",
|
|
|
"Content-Type": "application/json",
|
|
|
-}
|
|
|
+};
|
|
|
|
|
|
fetch(url, {
|
|
|
method: "GET",
|
|
@@ -122,31 +128,38 @@ fetch(url, {
|
|
|
> Example request:
|
|
|
|
|
|
```bash
|
|
|
-curl -X GET -G "http://localhost/api/withBodyParameters" \
|
|
|
+curl -X GET \
|
|
|
+ -G "http://localhost/api/withBodyParameters" \
|
|
|
-H "Authorization: customAuthToken" \
|
|
|
-H "Custom-Header: NotSoCustom" \
|
|
|
-H "Content-Type: application/json" \
|
|
|
- -d '{"user_id":9,"room_id":"consequatur","forever":false,"another_one":11613.31890586,"yet_another_param":{},"even_more_param":[],"book":{"name":"consequatur","author_id":17,"pages_count":17},"ids":[17],"users":[{"first_name":"John","last_name":"Doe"}]}'
|
|
|
+ -d '{"user_id":9,"room_id":"consequatur","forever":false,"another_one":11613.31890586,"yet_another_param":{"name":"consequatur"},"even_more_param":[11613.31890586],"book":{"name":"consequatur","author_id":17,"pages_count":17},"ids":[17],"users":[{"first_name":"John","last_name":"Doe"}]}'
|
|
|
|
|
|
```
|
|
|
|
|
|
```javascript
|
|
|
-const url = new URL("http://localhost/api/withBodyParameters");
|
|
|
+const url = new URL(
|
|
|
+ "http://localhost/api/withBodyParameters"
|
|
|
+);
|
|
|
|
|
|
let headers = {
|
|
|
"Authorization": "customAuthToken",
|
|
|
"Custom-Header": "NotSoCustom",
|
|
|
"Content-Type": "application/json",
|
|
|
"Accept": "application/json",
|
|
|
-}
|
|
|
+};
|
|
|
|
|
|
let body = {
|
|
|
"user_id": 9,
|
|
|
"room_id": "consequatur",
|
|
|
"forever": false,
|
|
|
"another_one": 11613.31890586,
|
|
|
- "yet_another_param": {},
|
|
|
- "even_more_param": [],
|
|
|
+ "yet_another_param": {
|
|
|
+ "name": "consequatur"
|
|
|
+ },
|
|
|
+ "even_more_param": [
|
|
|
+ 11613.31890586
|
|
|
+ ],
|
|
|
"book": {
|
|
|
"name": "consequatur",
|
|
|
"author_id": 17,
|
|
@@ -183,22 +196,23 @@ null
|
|
|
`GET api/withBodyParameters`
|
|
|
|
|
|
#### Body Parameters
|
|
|
-
|
|
|
Parameter | Type | Status | Description
|
|
|
--------- | ------- | ------- | ------- | -----------
|
|
|
user_id | integer | required | The id of the user.
|
|
|
- room_id | string | optional | The id of the room.
|
|
|
- forever | boolean | optional | Whether to ban the user forever.
|
|
|
- another_one | number | optional | Just need something here.
|
|
|
- yet_another_param | object | required |
|
|
|
- even_more_param | array | optional |
|
|
|
- book.name | string | optional |
|
|
|
- book.author_id | integer | optional |
|
|
|
- book[pages_count] | integer | optional |
|
|
|
- ids.* | integer | optional |
|
|
|
- users.*.first_name | string | optional | The first name of the user.
|
|
|
- users.*.last_name | string | optional | The last name of the user.
|
|
|
-
|
|
|
+ room_id | string | optional | The id of the room.
|
|
|
+ forever | boolean | optional | Whether to ban the user forever.
|
|
|
+ another_one | number | optional | Just need something here.
|
|
|
+ yet_another_param | object | required | Some object params.
|
|
|
+ yet_another_param.name | string | required | Subkey in the object param.
|
|
|
+ even_more_param | array | optional | Some array params.
|
|
|
+ even_more_param.* | float | optional | Subkey in the array param.
|
|
|
+ book.name | string | optional |
|
|
|
+ book.author_id | integer | optional |
|
|
|
+ book[pages_count] | integer | optional |
|
|
|
+ ids.* | integer | optional |
|
|
|
+ users.*.first_name | string | optional | The first name of the user.
|
|
|
+ users.*.last_name | string | optional | The last name of the user.
|
|
|
+
|
|
|
<!-- END_a25cb3b490fa579d7d77b386bbb7ec03 -->
|
|
|
|
|
|
<!-- START_5c545aa7f913d84b23ac4cfefc1de659 -->
|
|
@@ -206,29 +220,33 @@ Parameter | Type | Status | Description
|
|
|
> Example request:
|
|
|
|
|
|
```bash
|
|
|
-curl -X GET -G "http://localhost/api/withQueryParameters?location_id=consequatur&user_id=me&page=4&filters=consequatur&url_encoded=%2B+%5B%5D%26%3D" \
|
|
|
+curl -X GET \
|
|
|
+ -G "http://localhost/api/withQueryParameters?location_id=consequatur&user_id=me&page=4&filters=consequatur&url_encoded=%2B+%5B%5D%26%3D" \
|
|
|
-H "Authorization: customAuthToken" \
|
|
|
-H "Custom-Header: NotSoCustom"
|
|
|
```
|
|
|
|
|
|
```javascript
|
|
|
-const url = new URL("http://localhost/api/withQueryParameters");
|
|
|
-
|
|
|
- let params = {
|
|
|
- "location_id": "consequatur",
|
|
|
- "user_id": "me",
|
|
|
- "page": "4",
|
|
|
- "filters": "consequatur",
|
|
|
- "url_encoded": "+ []&=",
|
|
|
- };
|
|
|
- Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));
|
|
|
+const url = new URL(
|
|
|
+ "http://localhost/api/withQueryParameters"
|
|
|
+);
|
|
|
+
|
|
|
+let params = {
|
|
|
+ "location_id": "consequatur",
|
|
|
+ "user_id": "me",
|
|
|
+ "page": "4",
|
|
|
+ "filters": "consequatur",
|
|
|
+ "url_encoded": "+ []&=",
|
|
|
+};
|
|
|
+Object.keys(params)
|
|
|
+ .forEach(key => url.searchParams.append(key, params[key]));
|
|
|
|
|
|
let headers = {
|
|
|
"Authorization": "customAuthToken",
|
|
|
"Custom-Header": "NotSoCustom",
|
|
|
"Accept": "application/json",
|
|
|
"Content-Type": "application/json",
|
|
|
-}
|
|
|
+};
|
|
|
|
|
|
fetch(url, {
|
|
|
method: "GET",
|
|
@@ -266,20 +284,23 @@ Parameter | Status | Description
|
|
|
> Example request:
|
|
|
|
|
|
```bash
|
|
|
-curl -X GET -G "http://localhost/api/withAuthTag" \
|
|
|
+curl -X GET \
|
|
|
+ -G "http://localhost/api/withAuthTag" \
|
|
|
-H "Authorization: customAuthToken" \
|
|
|
-H "Custom-Header: NotSoCustom"
|
|
|
```
|
|
|
|
|
|
```javascript
|
|
|
-const url = new URL("http://localhost/api/withAuthTag");
|
|
|
+const url = new URL(
|
|
|
+ "http://localhost/api/withAuthTag"
|
|
|
+);
|
|
|
|
|
|
let headers = {
|
|
|
"Authorization": "customAuthToken",
|
|
|
"Custom-Header": "NotSoCustom",
|
|
|
"Accept": "application/json",
|
|
|
"Content-Type": "application/json",
|
|
|
-}
|
|
|
+};
|
|
|
|
|
|
fetch(url, {
|
|
|
method: "GET",
|
|
@@ -307,20 +328,23 @@ null
|
|
|
> Example request:
|
|
|
|
|
|
```bash
|
|
|
-curl -X POST "http://localhost/api/withMultipleResponseTagsAndStatusCode" \
|
|
|
+curl -X POST \
|
|
|
+ "http://localhost/api/withMultipleResponseTagsAndStatusCode" \
|
|
|
-H "Authorization: customAuthToken" \
|
|
|
-H "Custom-Header: NotSoCustom"
|
|
|
```
|
|
|
|
|
|
```javascript
|
|
|
-const url = new URL("http://localhost/api/withMultipleResponseTagsAndStatusCode");
|
|
|
+const url = new URL(
|
|
|
+ "http://localhost/api/withMultipleResponseTagsAndStatusCode"
|
|
|
+);
|
|
|
|
|
|
let headers = {
|
|
|
"Authorization": "customAuthToken",
|
|
|
"Custom-Header": "NotSoCustom",
|
|
|
"Accept": "application/json",
|
|
|
"Content-Type": "application/json",
|
|
|
-}
|
|
|
+};
|
|
|
|
|
|
fetch(url, {
|
|
|
method: "POST",
|
|
@@ -357,4 +381,74 @@ fetch(url, {
|
|
|
|
|
|
<!-- END_55f321056bfc0de7269ac70e24eb84be -->
|
|
|
|
|
|
+#Other😎
|
|
|
+
|
|
|
+
|
|
|
+<!-- START_33e62c07bc6d7286628b18c0e046ebea -->
|
|
|
+## api/echoesUrlParameters/{param}-{param2}/{param3?}
|
|
|
+> Example request:
|
|
|
+
|
|
|
+```bash
|
|
|
+curl -X GET \
|
|
|
+ -G "http://localhost/api/echoesUrlParameters/4-consequatur/?something=consequatur" \
|
|
|
+ -H "Authorization: customAuthToken" \
|
|
|
+ -H "Custom-Header: NotSoCustom"
|
|
|
+```
|
|
|
+
|
|
|
+```javascript
|
|
|
+const url = new URL(
|
|
|
+ "http://localhost/api/echoesUrlParameters/4-consequatur/"
|
|
|
+);
|
|
|
+
|
|
|
+let params = {
|
|
|
+ "something": "consequatur",
|
|
|
+};
|
|
|
+Object.keys(params)
|
|
|
+ .forEach(key => url.searchParams.append(key, params[key]));
|
|
|
+
|
|
|
+let headers = {
|
|
|
+ "Authorization": "customAuthToken",
|
|
|
+ "Custom-Header": "NotSoCustom",
|
|
|
+ "Accept": "application/json",
|
|
|
+ "Content-Type": "application/json",
|
|
|
+};
|
|
|
+
|
|
|
+fetch(url, {
|
|
|
+ method: "GET",
|
|
|
+ headers: headers,
|
|
|
+})
|
|
|
+ .then(response => response.json())
|
|
|
+ .then(json => console.log(json));
|
|
|
+```
|
|
|
+
|
|
|
+
|
|
|
+> Example response (200):
|
|
|
+
|
|
|
+```json
|
|
|
+{
|
|
|
+ "param": "4",
|
|
|
+ "param2": "consequatur",
|
|
|
+ "param3": null,
|
|
|
+ "param4": null
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+### HTTP Request
|
|
|
+`GET api/echoesUrlParameters/{param}-{param2}/{param3?}`
|
|
|
+
|
|
|
+#### URL Parameters
|
|
|
+
|
|
|
+Parameter | Status | Description
|
|
|
+--------- | ------- | ------- | -------
|
|
|
+ param | required |
|
|
|
+ param2 | optional |
|
|
|
+ param4 | optional |
|
|
|
+#### Query Parameters
|
|
|
+
|
|
|
+Parameter | Status | Description
|
|
|
+--------- | ------- | ------- | -----------
|
|
|
+ something | optional |
|
|
|
+
|
|
|
+<!-- END_33e62c07bc6d7286628b18c0e046ebea -->
|
|
|
+
|
|
|
|