public static interface HttpResponseMessage.Builder
A builder to create an instance of HttpResponseMessage
Method Details bodypublic abstract HttpResponseMessage.Builder body(Object body)
Sets the body of the HTTP response.
Parameters:
body - The body of the HTTP response
Returns:
this builder
buildpublic abstract HttpResponseMessage build()
Creates an instance of HttpMessageResponse with the values configured in this builder.
Returns:
an HttpMessageResponse object
headerpublic abstract HttpResponseMessage.Builder header(String key, String value)
Adds a (key, value) header to the response.
Parameters:
key - The key of the header value.
value - The value of the header value.
Returns:
this builder
statuspublic abstract HttpResponseMessage.Builder status(HttpStatusType status)
Sets the status code to be used in the HttpResponseMessage object. You can provide standard HTTP Status using enum values from HttpStatus, or you can create a custom status code using custom(int code).
Parameters:
status - An HTTP status code representing the outcome of the HTTP request.
Returns:
this builder
Applies toCollaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this articleWas this page helpful?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4