HttpRequest class

HTTP request object. Provided to your function when using HTTP Bindings.

Constructors

HttpRequest(HttpRequestInit)

For testing purposes only. This will always be constructed for you when run in the context of the Azure Functions runtime

Properties

arrayBuffer

Returns a promise fulfilled with the body as an ArrayBuffer

blob

Returns a promise fulfilled with the body as a Blob

body

Returns the body as a ReadableStream

bodyUsed

Returns whether the body has been read from

formData

Returns a promise fulfilled with the body as FormData

headers

HTTP request headers.

json

Returns a promise fulfilled with the body parsed as JSON

method

HTTP request method used to invoke this function.

params

Route parameter keys and values.

query

Query string parameter keys and values from the URL.

text

Returns a promise fulfilled with the body as a string

url

Request URL.

user

Object representing logged-in user, either through AppService/Functions authentication, or SWA Authentication null when no such user is logged in.

Constructor Details

HttpRequest(HttpRequestInit)

For testing purposes only. This will always be constructed for you when run in the context of the Azure Functions runtime

new HttpRequest(httpRequestInit: HttpRequestInit)

Parameters

httpRequestInit
HttpRequestInit

Property Details

arrayBuffer

Returns a promise fulfilled with the body as an ArrayBuffer

arrayBuffer: () => Promise<ArrayBuffer>

Property Value

() => Promise<ArrayBuffer>

blob

Returns a promise fulfilled with the body as a Blob

blob: () => Promise<Blob>

Property Value

() => Promise<Blob>

body

Returns the body as a ReadableStream

body: null | ReadableStream<any>

Property Value

null | ReadableStream<any>

bodyUsed

Returns whether the body has been read from

bodyUsed: boolean

Property Value

boolean

formData

Returns a promise fulfilled with the body as FormData

formData: () => Promise<FormData>

Property Value

() => Promise<FormData>

headers

HTTP request headers.

headers: Headers

Property Value

Headers

json

Returns a promise fulfilled with the body parsed as JSON

json: () => Promise<unknown>

Property Value

() => Promise<unknown>

method

HTTP request method used to invoke this function.

method: string

Property Value

string

params

Route parameter keys and values.

params: HttpRequestParams

Property Value

query

Query string parameter keys and values from the URL.

query: URLSearchParams

Property Value

URLSearchParams

text

Returns a promise fulfilled with the body as a string

text: () => Promise<string>

Property Value

() => Promise<string>

url

Request URL.

url: string

Property Value

string

user

Object representing logged-in user, either through AppService/Functions authentication, or SWA Authentication null when no such user is logged in.

user: null | HttpRequestUser

Property Value