UNPKG

@opra/client

Version:

Opra Client package

47 lines (46 loc) 1.25 kB
export declare namespace HttpResponse { interface Initiator { headers?: HeadersInit; status?: number; statusText?: string; url?: string; body?: any; hasBody?: boolean; } } export declare class HttpResponse<TBody = any> { /** * Contains the Headers object associated with the response. */ readonly headers: Headers; /** * Contains a Boolean stating whether the response was successful (status in the range 200-299) or not. */ readonly ok: boolean; /** * Contains the HTTP status codes of the response */ readonly status: number; /** * Contains the status message corresponding to the HTTP status code in status property */ readonly statusText: string; /** * Contains the URL of the response */ readonly url: string | null; /** * Body contents */ readonly body: TBody; /** * Content-Type header value without encoding part */ readonly contentType: string; /** * Returns true if response has body to be received */ readonly hasBody: boolean; constructor(init?: HttpResponse.Initiator); clone(update?: HttpResponse.Initiator): HttpResponse; }