Skip to main content
Branch: Release Candidate

HttpClient

Hierarchy

  • BaseObject
    • HttpClient

Index

Constructors

publicconstructor

  • new HttpClient(): HttpClient

Properties

publicreadonlyid

id: number

publicreadonlyisRemote

isRemote: boolean

Whether this entity was created clientside or serverside. (Clientside = false, Serverside = true).

publicreadonlyrefCount

refCount: number

Returns the ref count of the entity.

Remarks

It’s only available in debug-mode.

publicreadonlyremoteID

remoteID: number

The serverside id of this entity.

publicreadonlytype

type: BaseObjectType

Type of the object.

publicreadonlyvalid

valid: boolean

Object usability.

Returns

False if object is no longer usable.

Methods

publicconnect

  • connect(url: string, body: string): Promise<IHttpResponse>

publicdelete

  • delete(url: string, body: string): Promise<IHttpResponse>

publicdeleteMeta

  • deleteMeta(key: string): void
  • deleteMeta<K>(key: K): void

publicdestroy

  • destroy(): void
  • Removes the object from the world.

publicget

  • get(url: string): Promise<IHttpResponse>

publicgetExtraHeaders

  • getExtraHeaders(): Record<string, string>

publicgetMeta

  • getMeta<K>(key: Exclude<K, never>): unknown
  • getMeta<K>(key: K): undefined | ICustomBaseObjectMeta[K]
  • getMeta<V>(key: string): undefined | V
  • Type parameters

    • K: string

publicgetMetaDataKeys

  • getMetaDataKeys(): readonly string[]

publicgetSyncedMeta

  • getSyncedMeta<K>(key: Exclude<K, never>): unknown
  • getSyncedMeta<K>(key: K): undefined | ICustomBaseObjectSyncedMeta[K]
  • getSyncedMeta<V>(key: string): undefined | V
  • Gets a value using the specified key.


    Type parameters

    • K: string

publicgetSyncedMetaKeys

  • getSyncedMetaKeys(): readonly string[]

publichasMeta

  • hasMeta(key: string): boolean
  • hasMeta<K>(key: K): boolean

publichasSyncedMeta

  • hasSyncedMeta(key: string): boolean
  • hasSyncedMeta<K>(key: K): boolean
  • Determines whether contains the specified key.

publichead

  • head(url: string): Promise<IHttpResponse>

publicoptions

  • options(url: string, body: string): Promise<IHttpResponse>

publicpatch

  • patch(url: string, body: string): Promise<IHttpResponse>

publicpost

  • post(url: string, body: string): Promise<IHttpResponse>

publicput

  • put(url: string, body: string): Promise<IHttpResponse>

publicsetExtraHeader

  • setExtraHeader(header: string, value: string): void

publicsetMeta

  • setMeta<K>(key: K, value: InterfaceValueByKey<ICustomBaseObjectMeta, K, unknown, void>): void
  • setMeta<K>(key: K, value: ICustomBaseObjectMeta[K]): void
  • setMeta<V, K>(key: K, value: InterfaceValueByKey<ICustomBaseObjectMeta, K, V, void>): void
  • Type parameters

    • K: string

publictrace

  • trace(url: string, body: string): Promise<IHttpResponse>

publicstaticgetByID

  • getByID(id: number): null | HttpClient
  • Retrieves the httpclient from the pool.

publicstaticgetByRemoteID

  • getByRemoteID(type: BaseObjectType, id: number): null | BaseObject