Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature http status codes #376

Merged
merged 2 commits into from
Nov 27, 2022
Merged

Feature http status codes #376

merged 2 commits into from
Nov 27, 2022

Conversation

juhaku
Copy link
Owner

@juhaku juhaku commented Nov 27, 2022

Add support for http::status::StatusCode to be used as response
status.

For example path expression can be used to to define response status
code. It does not check whether http crate itself is present in
dependencies but the http status must match know status code defined
in http::status::StatusCode.

(status = http::status::StatusCode::OK, description = "success")
(status = StatusCode::NOT_FOUND, description = "not found")
(status = INTERNAL_SERVER_ERROR, description = "internal server error")

Resolves #304, Resolves #301

Add support for `http::status::StatusCode` to be used as response
status.

For example path expression can be used to to define response status
code. It does not check whether `http` crate itself is present in
dependencies but the http status must match know status code defined
in `http::status::StatusCode`.
```
(status = http::status::StatusCode::OK, description = "success")
(status = StatusCode::NOT_FOUND, description = "not found")
(status = INTERNAL_SERVER_ERROR, description = "internal server error")
```
@juhaku juhaku marked this pull request as ready for review November 27, 2022 20:38
@juhaku juhaku merged commit 1df2773 into master Nov 27, 2022
@juhaku juhaku deleted the feature-http-status-codes branch November 27, 2022 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Released
Development

Successfully merging this pull request may close these issues.

Allow the the statuscode in the path macro to be a http::StatusCode?
2 participants