HttpResponse Class

An HTTP response object.

Inheritance
azure.functions._abc.HttpResponse
HttpResponse

Constructor

HttpResponse(body=None, *, status_code=None, headers=None, mimetype=None, charset=None)

Parameters

body
<xref:<xref:str/bytes>>
default value: None

Optional response body.

status_code
int
Required

Response status code. If not specified, defaults to 200.

headers
dict
Required

An optional mapping containing response HTTP headers.

mimetype
str
Required

An optional response MIME type. If not specified, defaults to 'text/plain'.

charset
str
Required

Response content text encoding. If not specified, defaults to 'utf-8'.

Methods

get_body

Response body as a bytes object.

get_body

Response body as a bytes object.

get_body() -> bytes

Attributes

charset

Response text encoding.

headers

A dictionary of response HTTP headers.

mimetype

Response MIME type.

status_code

Response status code.