Skip to content

Feature error endpoint #43

Merged
merged 3 commits into from
Jul 12, 2021
Merged

Feature error endpoint #43

merged 3 commits into from
Jul 12, 2021

Conversation

campb303
Copy link
Collaborator

Created HTTPResponse resource with a get method that builds a list of HTTP response codes and messages from the http.HTTPStatus symbol and returns the requested response code and message or a 404 message if the requested response code is not found. Requesting a 404 directly will return the standard 404 message.

The HTTPResponse resource was added to the API path at /api/error/<int:response_code>.

Example:

# Start API
gunicorn webqueue2api.api:app

# Request 301 response
curl localhost:8000/api/error/301
// Expeted Output
{"message": "Moved Permanently"}

@campb303 campb303 merged commit a9fecd7 into staging Jul 12, 2021
@campb303 campb303 deleted the feature-error-endpoint branch July 12, 2021 16:46
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant