A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.microsoft.com/en-us/java/api/com.microsoft.azure.functions.httpresponsemessage.builder below:

HttpResponseMessage.Builder Interface | Microsoft Learn

HttpResponseMessage.Builder Interface

public static interface HttpResponseMessage.Builder

A builder to create an instance of HttpResponseMessage

Method Details body

public abstract HttpResponseMessage.Builder body(Object body)

Sets the body of the HTTP response.

Parameters:

body - The body of the HTTP response

Returns:

this builder

build

public abstract HttpResponseMessage build()

Creates an instance of HttpMessageResponse with the values configured in this builder.

Returns:

an HttpMessageResponse object

header

public 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

status

public 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 to

Collaborate 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 article

Was 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