Skip to main content

RemoteServiceHttpRequest

Class

A http request which can be sent using the RemoteServiceModule.

  • Snapchat: not supported
  • SPECS: fully supported
  • Camera Kit Web: fully supported
  • Camera Kit Mobile: fully supported
  • SnapchatNot supported — Available on SPECS and Camera Kit only
  • SPECSFully supported
  • Camera Kit WebFully supported
  • Camera Kit MobileFully supported

Platform details

  • Snapchat — Not supported — Available on SPECS and Camera Kit only.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

Since Lens Scripting v271

A http request which can be sent using the RemoteServiceModule.

Index

Extends

Properties

body

body: string | Uint8Array<ArrayBufferLike> | number[]

SPECSCamera Kit

The body of the http request.

Since

Lens Scripting Version 271

Default Value

""
@snapOS
@cameraKit

contentType

contentType: string

SPECSCamera Kit

The content type of the http request.

Since

Lens Scripting Version 271

Default Value

""
@snapOS
@cameraKit

headers

headers: object

SPECSCamera Kit

The headers of the http request.

Index Signature

[key: string]: string

Since

Lens Scripting Version 271

Default Value

{}
@snapOS
@cameraKit

method

method: HttpRequestMethod

SPECSCamera Kit

The method which should be used to send this http request.

Since

Lens Scripting Version 271

Default Value

RemoteServiceHttpRequest.HttpRequestMethod.Get
@snapOS
@cameraKit

url

url: string

SPECSCamera Kit

The URL which this http request should point to.

Since

Lens Scripting Version 271

Default Value

""
@snapOS
@cameraKit

Methods

create()

static create(): RemoteServiceHttpRequest

SPECSCamera Kit

Create a new http request.

Returns

RemoteServiceHttpRequest


getHeader()

getHeader(name): string

SPECSCamera Kit

Get the header of the http request.

Parameters

ParameterType
namestring

Returns

string

Since

Lens Scripting Version 271


getTypeName()

static getTypeName(): TypeName<RemoteServiceHttpRequest>

SPECSCamera Kit

Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

Returns

TypeName<RemoteServiceHttpRequest>

Since

Lens Scripting Version 271

Overrides

ScriptObject.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

ScriptObject.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object matches or derives from the passed in type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

ScriptObject.isOfType


isSame()

isSame(other): boolean

Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

ScriptObject.isSame


setHeader()

setHeader(name, value): void

SPECSCamera Kit

Set the header of the http request.

Parameters

ParameterType
namestring
valuestring

Returns

void

Since

Lens Scripting Version 271

Nested types

Enumerations

EnumerationDescription
HttpRequestMethodThe http method which should be used to send this http request.