Home Reference Source
public class | source

BaseService

Base Web Service class. Extend and specific services here

Constructor Summary

Public Constructor
public

constructor(baseUrl: *, relativePath: *)

Creates Service instance

Member Summary

Public Members
public get

http: *: *

Method Summary

Public Methods
public

query(method: string, data: undefined): Promise

public

Calls a HTTP Get with given BRS Url

public

Mounts a BRS conform API endpoint of format <host>?requestType=getBlock&height=123

Public Constructors

public constructor(baseUrl: *, relativePath: *) source

Creates Service instance

Params:

NameTypeAttributeDescription
baseUrl *

The host url of web service

relativePath *

The relative path will be prepended before each url created with toBRSEndpoint()

Public Members

public get http: *: * source

Return:

*

The internal Http client

Public Methods

public query(method: string, data: undefined): Promise source

Params:

NameTypeAttributeDescription
method string
data undefined

Return:

Promise

public requestGet(brsUrl: string): Promise source

Calls a HTTP Get with given BRS Url

Params:

NameTypeAttributeDescription
brsUrl string

Return:

Promise

public toBRSEndpoint(method: string, data: undefined): string source

Mounts a BRS conform API endpoint of format <host>?requestType=getBlock&height=123

Params:

NameTypeAttributeDescription
method string
data undefined

Return:

string