Interface SinonFakeXMLHttpRequest

Index

Properties

Methods

Properties

public async: boolean

public method: string

public onCreate: (xhr: SinonFakeXMLHttpRequest) => void

public password: string

public requestBody: string

public requestHeaders: any

public responseXML: Document

public status: number

public statusText: string

public upload: SinonFakeUploadProgress

public url: string

public useFilters: boolean

public username: string

public withCredentials: boolean

Methods

public addFilter(filter: (method: string, url: string, async: boolean, username: string, password: string) => boolean)

Parameters

  • filter: (method: string, url: string, async: boolean, username: string, password: string) => boolean

public autoRespond(ms: number)

Parameters

  • ms: number

public getAllResponseHeaders(): any

Returns

any

public getResponseHeader(header: string): string

Parameters

  • header: string

Returns

string

public respond(status: number, headers: any, body: string)

Parameters

  • status: number
  • headers: any
  • body: string

public restore()

public setResponseBody(body: string)

Parameters

  • body: string

public setResponseHeaders(headers: any)

Parameters

  • headers: any