-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
122 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# **GPTS**' default response for unconfigured routes | ||
|
||
If user is attempting to send a request for unconfigured route, the application will respond with a predefined response, which consists of following fields: | ||
|
||
| Field name | Value type | Description | | ||
|-|-|-| | ||
| `host` | `string` | Hostname for which the request was sent | | ||
| `path` | `string` | Path for which the request was sent | | ||
| `method` | `string` | HTTP method of the sent request | | ||
| `headers` | `string` to `string` map | HTTP headers of the sent request | | ||
| `queries` | `string` to `string` map | Query values of the sent request | | ||
|
||
By default the response is returned in JSON format, but it is possible to retrieve it in YAML format by using `Accept: text/yaml` header. | ||
|
||
=== "Example of JSON response" | ||
```json | ||
{ | ||
"host": "localhost:8080", | ||
"path": "/some-path", | ||
"method": "GET", | ||
"headers": { | ||
"Accept": "*/*", | ||
"User-Agent": "curl/7.81.0" | ||
}, | ||
"queries": { | ||
"param1": "someValue", | ||
"param2": "someOtherValue" | ||
} | ||
} | ||
``` | ||
=== "Example of YAML response" | ||
```yaml | ||
host: localhost:8080 | ||
path: / | ||
method: GET | ||
headers: | ||
Accept: text/yaml | ||
User-Agent: curl/7.81.0 | ||
queries: | ||
param1: someValue | ||
param2: someOtherValue | ||
``` | ||
|
||
!!! important "Changing the default response" | ||
Please note that default response is hardcoded in the application, so it cannot be changed directly. In order to override it, the route for path `/` with `allowSubpaths` option enabled must be manually created and added to the configuration. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters