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 Request] Robyn providing Status Codes? #423

Closed
carlosm27 opened this issue Feb 19, 2023 · 2 comments · Fixed by #429
Closed

[Feature Request] Robyn providing Status Codes? #423

carlosm27 opened this issue Feb 19, 2023 · 2 comments · Fixed by #429
Labels
enhancement New feature or request

Comments

@carlosm27
Copy link
Contributor

carlosm27 commented Feb 19, 2023

It would be more appropriate if Robyn provides status codes instead of hard coding them?
I create a branch with "status.py" file in it, it is a copy/paste of Starlette HTTP status code.

Current Behavior
Hard coding the status code like:

return {
        "status_code": 200,
        "body": "some body",
        "type": "text",
  
    }

Desired Behavior
Robyn providing status codes like:

return {
        "status_code": status.HTTP_200_OK,
        "body": "Some body",
        "type": "text",

    }
@carlosm27 carlosm27 added the enhancement New feature or request label Feb 19, 2023
@sansyrox
Copy link
Member

@carlosm27 , that's a great idea. Can you open a PR? We can store them in an enum too.

@carlosm27
Copy link
Contributor Author

@sansyrox Yes, I think an enum will be more appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants