@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
Methods
includeBody
▸ includeBody(method
): boolean
should body
be included in the request
Parameters
Name | Type |
---|---|
method | HttpMethod |
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
Name | Type |
---|---|
response | Response |
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
Name | Type |
---|---|
method | HttpMethod |
urlStr | string |
urlParameters | Map <string , string > |
httpHeaders | Map <string , string > |
body? | string | Record <string , any > |
Returns
Promise
<ApiResponse
<T
>>