Home Manual Reference Source
import HttpDjangoFileRequest from 'ievv_jsbase/lib/http/HttpDjangoFileRequest'
public class | source

HttpDjangoFileRequest

Extends:

HttpRequestHttpFileRequest → HttpDjangoFileRequest

Extends HttpFileRequest with automatic handling of the Django csrftoken.

Constructor Summary

Public Constructor
public

constructor(args: *)

Member Summary

Public Members
public get

Returns the value of the csrftoken cookie.

Method Summary

Public Methods
public

Ensures the csrftoken cookie value is automatically set in the X-CSRFToken header for all request except GET and HEAD.

Inherited Summary

From class HttpRequest
public get

Get the parsed URL of the request.

public

request: *

public
public

deepCopy(): *

Create a deep copy of this HttpRequest object.

public

get(data: *): *

Shortcut for send("get", data).

public

head(data: *): *

Shortcut for send("head", data).

public

httpdelete(data: *): *

Shortcut for send("delete", data).

public

makeRequestBody(data: *): *

Make request body from the provided data.

public

Creates a HttpResponse.

public

patch(data: *): *

Shortcut for send("patch", data).

public

post(data: *): *

Shortcut for send("post", data).

public

put(data: *): *

Shortcut for send("put", data).

public

send(method: *, data: *): Promise

Send the request.

public

Set default request headers.

public

setRequestHeader(header: *, value: *)

Set a request header.

public

setTreatRedirectResponseAsError(treatRedirectResponseAsError: bool)

Set how we treat 3xx responses.

public

setUrl(url: String)

Set the URL of the request.

From class HttpFileRequest
public

Overridden to return the response as a HttpFileResponse instead of a HttpResponse.

public

Overridden to ensure we send the correct content-type header for file requests.

Public Constructors

public constructor(args: *) source

Override:

HttpRequest#constructor

Params:

NameTypeAttributeDescription
args *

Same args as for HttpResponse

Public Members

public get csrftoken: string: * source

Returns the value of the csrftoken cookie.

Return:

string

Csrf token.

Public Methods

public setDefaultRequestHeaders(method: *) source

Ensures the csrftoken cookie value is automatically set in the X-CSRFToken header for all request except GET and HEAD.

Override:

HttpFileRequest#setDefaultRequestHeaders

Params:

NameTypeAttributeDescription
method *

See HttpRequest.