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

Add support for built in HTTP status response codes #575

Closed
thekalinga opened this issue Mar 13, 2018 · 2 comments
Closed

Add support for built in HTTP status response codes #575

thekalinga opened this issue Mar 13, 2018 · 2 comments

Comments

@thekalinga
Copy link

thekalinga commented Mar 13, 2018

Type: Enhancement

Currently we have to type response codes manually such as 200, 403, e.t.c as part of response closure. Though it is not that hard to remember most commonly used response codes, its not easy to remember the meaning of each response code.

It would be much more helpful for developers if there is a provision for uses to use methods like ok() which can refer to HTTP status code 200

This can function similar to existing API of HttpHeaders which allows users to write accept() instead of typing 'Accept'

This makes the API less error prone & more readable

@thekalinga thekalinga changed the title Add support for HTTP response codes Add support for built in HTTP response codes Mar 13, 2018
@thekalinga thekalinga changed the title Add support for built in HTTP response codes Add support for built in HTTP status response codes Mar 13, 2018
@thekalinga
Copy link
Author

This class HttpStatus can be used as a reference for this

@marcingrzejszczak
Copy link
Contributor

That's a great option for a first PR. A good reference is the org.springframework.cloud.contract.spec.internal.HttpHeaders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants