1.0.0-alpha.7 • Published 5 years ago

@helixnetwork/http-client v1.0.0-alpha.7

Weekly downloads
8
License
MIT
Repository
github
Last release
5 years ago

@helixnetwork/http-client

Sends commands to helix over HTTP. Allows to create a network provider compatible with functions in @helixnetwork/core.

Installation

Install using npm:

npm install @helixnetwork/http-client

or using yarn:

yarn add @helixnetwork/http-client

API Reference

http-client.send(command, uri, apiVersion)

Fulil: Object - Response
Reject: Error - Request error

ParamTypeDefault
commandCommand
uriStringhttp://localhost:14265
apiVersionString | Number1

Sends an http request to a specified host.

Returns: Promise

http-client~send

ParamType
commandobject

Returns: object - response

http-client~setSettings

ParamTypeDefaultDescription
settingsobject{}
settings.providerstring"http://localhost:14265"Uri of helix node
settings.apiVersionstring | number1Helix Api version to be sent as X-HELIX-API-Version header.
settings.requestBatchSizenumber1000Number of search values per request.

http-client~createHttpClient(settings)

ParamTypeDefaultDescription
settingsobject{}
settings.providerstring"http://localhost:14265"Uri of helix node
settings.timeoutnumberTimeout
settings.apiVersionstring | number1Helix Api version to be sent as X-HELIX-API-Version header.
settings.requestBatchSizenumber1000Number of search values per request.

Create an http client to access helix http API.

Returns: Object