Skip to main content

LensStudio:Network.HttpRequest

Class

A HTTP Request configuration.

A HTTP Request configuration. Use with "LensStudio:Network".performHttpRequestWithReply.

Index

Example

// Note: reply object needs to be stored (e.g. in `this` object of the plugin)
// in order for the network connection to be maintained.
const reply = performHttpRequestWithReply(httpRequest);
reply.onData.connect((buffer) => {
console.log('Received data chunk: ' + buffer.toString());
});
reply.onEnd.connect(response => {
console.log(response.statusCode);
});
reply.onError.connect(response => {});

Constructors

Constructor

new HttpRequest(): HttpRequest

Constructs a new HttpRequest object for use with performHttpRequest or performAuthorizedHttpRequest.

Returns

HttpRequest

Properties

authorization

authorization: IAuthorization

Authorization credentials attached to the HTTP request.


body

body: string | Uint8Array<ArrayBufferLike> | FormData

The body for the HTTP Request.


contentType

contentType: string

The content type of the request body.


headers

headers: any

The header for the HTTP request.


method

method: Method

The HTTP method to send the request with.


url

url: string

The URL where the request should be made to.

Nested types

Enumerations

EnumerationDescription
MethodThe method in which to send the HTTP request. Use with "LensStudio:Network".HttpRequest.