Options
All
  • Public
  • Public/Protected
  • All
Menu
example

send data as Content-Type: multipart/form-data (default) const request = new AjaxRequest('/endpoint'); const response = request.post({item: { first: 'value'}}); // sends item[first]=value in request body (analogous) // can be used like this server-side // $value = ServerRequest::getParsedBody()['item']['first']

example

send data as Content-Type: application/json (must be set explicit) const request = new AjaxRequest('/endpoint'); const response = request.post({item: { first: 'value'}}); // sends {"item":{"first":"value"}} in request body // can be used like this server-side // $value = json_decode((string)ServerRequest::getBody(), true)['item']['first']

Hierarchy

  • AjaxRequest

Index

Constructors

constructor

Properties

Private Readonly abortController

abortController: AbortController

Private queryArguments

queryArguments: string = ''

Private Readonly url

url: string

Static Private defaultOptions

defaultOptions: RequestInit = ...

Methods

abort

  • abort(): void

Private clone

Private composeRequestUrl

  • composeRequestUrl(): string

delete

get

Private getMergedOptions

  • getMergedOptions(init: RequestInit): RequestInit

post

put

Private send

  • send(init?: RequestInit): Promise<Response>

withQueryArguments

Generated using TypeDoc