Skip to content

Commit

Permalink
Add HTTPResponse /api/error/<int:response_code> docs
Browse files Browse the repository at this point in the history
  • Loading branch information
campb303 committed Jul 12, 2021
1 parent a9fecd7 commit a59ea8b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs-src/api/Simulating Responses.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Returns the requested HTTP response with a JSON payload containing the response phrase. Valid response codes and phrases are pulled from the [Python `http` library index](https://docs.python.org/3/library/http.html#http.HTTPStatus).

## Endpoint
```
GET /api/error/{response_code}
```
### Parameters
Name | Value
- | -
`response_code` | The HTTP response code to be returned.

## Example
```bash
curl {{production_url}}/api/error/301
```
```jsonc
// Expected Output
{"message": "Moved Permanently"}
```

0 comments on commit a59ea8b

Please sign in to comment.