Skip to main content

@hyperledger/identus-edge-agent-sdk / Exports / ApiImpl

Class: ApiImpl

Implement API using built in fetch

Implements

Table of contents

Constructors

Methods

Constructors

constructor

new ApiImpl(): ApiImpl

Returns

ApiImpl

Methods

includeBody

includeBody(method): boolean

should body be included in the request

Parameters

NameType
methodHttpMethod

Returns

boolean

Defined in

src/edge-agent/helpers/FetchApi.ts:55


parseResponse

parseResponse(response): Promise<any>

attempt to convert response to JSON or return as string

Parameters

NameType
responseResponse

Returns

Promise<any>

Defined in

src/edge-agent/helpers/FetchApi.ts:66


request

request<T>(method, urlStr, urlParameters?, httpHeaders?, body?): Promise<ApiResponse<T>>

make a request return an ApiResponse on any 2xx status throw ApiError otherwise

Type parameters

Name
T

Parameters

NameType
methodHttpMethod
urlStrstring
urlParametersMap<string, string>
httpHeadersMap<string, string>
body?string | Record<string, any>

Returns

Promise<ApiResponse<T>>

Implementation of

Api.request

Defined in

src/edge-agent/helpers/FetchApi.ts:7