HttpResponseMessage.Builder Interface

Definition

A builder to create an instance of HttpResponseMessage

public static interface HttpResponseMessage.Builder

Methods

body(Object body)

Sets the body of the HTTP response.

build()

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

header(String key, String value)

Adds a (key, value) header to the response.

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).

Applies to