HttpResponseMessage Interface

public interface HttpResponseMessage

An HttpResponseMessage instance is returned by Azure Functions methods that are triggered by an HttpTrigger.

Method Summary

Modifier and Type Method and Description
Object getBody()

Returns the body of the HTTP response.

String getHeader(String key)

Returns a header value for the given key.

HttpStatusType getStatus()

Returns the HTTP status code set on the HttpResponseMessage instance.

default int getStatusCode()

Returns the HTTP status code set on the HttpResponseMessage instance.

Method Details

getBody

public Object getBody()

Returns the body of the HTTP response.

Returns:

the body of the HTTP response.

getHeader

public String getHeader(String key)

Returns a header value for the given key.

Parameters:

key - The key for which the header value is sought.

Returns:

Returns the value if the key has previously been added, or null if it has not.

getStatus

public HttpStatusType getStatus()

Returns the HTTP status code set on the HttpResponseMessage instance.

Returns:

the status code set on the HttpResponseMessage instance.

getStatusCode

public default int getStatusCode()

Returns the HTTP status code set on the HttpResponseMessage instance.

Returns:

the status code set on the HttpResponseMessage instance.

Applies to