Skip to main content

WebServiceConnector

@nevermined-io/sdk - v3.0.44 / WebServiceConnector

Class: WebServiceConnector

Provides a common interface to web services.

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new WebServiceConnector(config): WebServiceConnector

Parameters

NameType
configInstantiableConfig

Returns

WebServiceConnector

Defined in

src/nevermined/utils/WebServiceConnector.ts:26

Properties

config

config: InstantiableConfig

Defined in

src/nevermined/utils/WebServiceConnector.ts:24

Methods

_sleep

_sleep(ms): Promise\<unknown>

Parameters

NameType
msnumber

Returns

Promise\<unknown>

Defined in

src/nevermined/utils/WebServiceConnector.ts:238


delete

delete(url, payload?, headers?): Promise\<Response>

Parameters

NameType
urlstring
payload?BodyInit
headersObject

Returns

Promise\<Response>

Defined in

src/nevermined/utils/WebServiceConnector.ts:71


downloadFile

downloadFile(url, destination?, index?, headers?): Promise\<string>

Parameters

NameType
urlstring
destination?string
index?number
headers?Object

Returns

Promise\<string>

Defined in

src/nevermined/utils/WebServiceConnector.ts:86


downloadUrl

downloadUrl(url, headers?): Promise\<string>

Parameters

NameType
urlstring
headers?any

Returns

Promise\<string>

Defined in

src/nevermined/utils/WebServiceConnector.ts:139


fetch

fetch(url, opts, numberTries?): Promise\<Response>

Parameters

NameTypeDefault value
urlanyundefined
optsRequestInitundefined
numberTriesnumber1

Returns

Promise\<Response>

Defined in

src/nevermined/utils/WebServiceConnector.ts:221


fetchCID

fetchCID(cid): Promise\<string>

Parameters

NameType
cidstring

Returns

Promise\<string>

Defined in

src/nevermined/utils/WebServiceConnector.ts:193


fetchToken

fetchToken(url, grantToken, numberTries?, apiKeyHash?): Promise\<Response>

Parameters

NameTypeDefault value
urlstringundefined
grantTokenstringundefined
numberTriesnumber1
apiKeyHash?stringundefined

Returns

Promise\<Response>

Defined in

src/nevermined/utils/WebServiceConnector.ts:165


get

get(url, headers?): Promise\<Response>

Parameters

NameType
urlany
headersObject

Returns

Promise\<Response>

Defined in

src/nevermined/utils/WebServiceConnector.ts:47


getFileResponse

getFileResponse(url, index?, headers?): Promise\<{ name: string ; response: Response }>

Parameters

NameType
urlstring
index?number
headers?Object

Returns

Promise\<{ name: string ; response: Response }>

Defined in

src/nevermined/utils/WebServiceConnector.ts:113


post

post(url, payload, headers?): Promise\<Response>

Parameters

NameType
urlstring
payloadBodyInit
headersObject

Returns

Promise\<Response>

Defined in

src/nevermined/utils/WebServiceConnector.ts:32


put

put(url, payload, headers?): Promise\<Response>

Parameters

NameType
urlstring
payloadBodyInit
headersObject

Returns

Promise\<Response>

Defined in

src/nevermined/utils/WebServiceConnector.ts:56


uploadFile

uploadFile(url, data, encrypt?): Promise\<any>

Parameters

NameType
urlstring
dataReadStream
encrypt?boolean

Returns

Promise\<any>

Defined in

src/nevermined/utils/WebServiceConnector.ts:156


uploadMessage

uploadMessage(url, data, encrypt?): Promise\<any>

Parameters

NameType
urlstring
datastring
encrypt?boolean

Returns

Promise\<any>

Defined in

src/nevermined/utils/WebServiceConnector.ts:147


getIPFSAuthToken

getIPFSAuthToken(): undefined | string

Returns

undefined | string

Defined in

src/nevermined/utils/WebServiceConnector.ts:211