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:str/bytes>

Optional response body.

status_code
int

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

headers
dict

An optional mapping containing response HTTP headers.

mimetype
str

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

charset
str

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.