HttpRequest Class

An HTTP request object.

Inheritance
azure.functions._abc.HttpRequest
HttpRequest

Constructor

HttpRequest(method: str, url: str, *, headers: Optional[Mapping[str, str]] = None, params: Optional[Mapping[str, str]] = None, route_params: Optional[Mapping[str, str]] = None, body: bytes)

Parameters

method
str
Required

HTTP request method name.

url
str
Required

HTTP URL.

headers
dict
Required

An optional mapping containing HTTP request headers.

params
dict
Required

An optional mapping containing HTTP request params.

route_params
dict
Required

An optional mapping containing HTTP request route params.

body
bytes
Required

HTTP request body.

Methods

get_body

Return request body as bytes.

get_json

Decode and return request body as JSON.

get_body

Return request body as bytes.

get_body() -> bytes

get_json

Decode and return request body as JSON.

get_json() -> Any

Exceptions

when the request does not contain valid JSON data.

Attributes

files

form

headers

A dictionary containing request headers.

method

Request method.

params

A dictionary containing request GET parameters.

route_params

A dictionary containing request route parameters.

url

Request URL.