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

Name Description
body
<xref:<xref:str/bytes>>

Optional response body.

Default value: None
status_code
Required
int

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

headers
Required

An optional mapping containing response HTTP headers.

mimetype
Required
str

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

charset
Required
str

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

Keyword-Only Parameters

Name Description
status_code
Required
headers
Required
mimetype
Required
charset
Required

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.