# @helixnetwork/http-client

> Send commands to a helix node over HTTP.

Latest version **1.0.0-alpha.7** (published 2019-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @helixnetwork/http-client
pnpm add @helixnetwork/http-client
yarn add @helixnetwork/http-client
bun add @helixnetwork/http-client
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0-alpha.7 |
| Published | 2019-09-24 |
| First published | 2019-02-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 231.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | ahasikos, ajith_er, dad1x, dnck, dt93, dzlzv, fsbbn, mahi30795, netobjex, ofo42, sachushaji, shahanaspatel17, stefan-precup, tittu, tunghoang, vipindas28 |
| Keywords | helix, tangle, library, browser, javascript, nodejs, API |

## Links

- npm: https://www.npmjs.com/package/@helixnetwork/http-client
- Repository: https://github.com/helixnetwork/helix.api
- Homepage: https://github.com/helixnetwork/helix.api#readme
- Issues: https://github.com/helixnetwork/helix.api/issues
- npm.io page: https://npm.io/package/@helixnetwork/http-client

## Dependencies (5)

- [bluebird](https://npm.io/package/bluebird.md) ^3.5.1
- [@types/bluebird](https://npm.io/package/@types/bluebird.md) ^3.5.20
- [abort-controller](https://npm.io/package/abort-controller.md) ^3.0.0
- [isomorphic-fetch](https://npm.io/package/isomorphic-fetch.md) ^2.2.1
- [@types/isomorphic-fetch](https://npm.io/package/@types/isomorphic-fetch.md) ^0.0.34

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.0-alpha.7 (latest) — 2019-09-24
- 1.0.0-alpha.6 — 2019-08-15
- 1.0.0-alpha.5 — 2019-08-06
- 1.0.0-alpha.4 — 2019-07-31
- 1.0.0-alpha.3 — 2019-07-24
- 1.0.0-alpha.2 — 2019-05-09
- 1.0.0-alpha.1 — 2019-03-02
- 1.0.0-alpha.0 — 2019-02-26

## README

# @helixnetwork/http-client

Sends commands to [`helix`](https://github.com/iotaledger/iri) over `HTTP`.
Allows to create a network provider compatible with functions in [`@helixnetwork/core`](../core).

## Installation

Install using [npm](https://www.npmjs.org/):
```
npm install @helixnetwork/http-client
```

or using [yarn](https://yarnpkg.com/):

```
yarn add @helixnetwork/http-client
```

## API Reference

    
* [http-client](#module_http-client)

    * _static_
        * [.send(command, [uri], [apiVersion])](#module_http-client.send)

    * _inner_
        * [~send](#module_http-client..send)

        * [~setSettings](#module_http-client..setSettings)

        * [~createHttpClient([settings])](#module_http-client..createHttpClient)


<a name="module_http-client.send"></a>

### *http-client*.send(command, [uri], [apiVersion])
**Fulil**: <code>Object</code> - Response  
**Reject**: <code>Error</code> - Request error  

| Param | Type | Default |
| --- | --- | --- |
| command | <code>Command</code> |  | 
| [uri] | <code>String</code> | <code>http://localhost:14265</code> | 
| [apiVersion] | <code>String</code> \| <code>Number</code> | <code>1</code> | 

Sends an http request to a specified host.

**Returns**: Promise  
<a name="module_http-client..send"></a>

### *http-client*~send

| Param | Type |
| --- | --- |
| command | <code>object</code> | 

**Returns**: <code>object</code> - response  
<a name="module_http-client..setSettings"></a>

### *http-client*~setSettings

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| [settings] | <code>object</code> | <code>{}</code> |  |
| [settings.provider] | <code>string</code> | <code>&quot;http://localhost:14265&quot;</code> | Uri of helix node |
| [settings.apiVersion] | <code>string</code> \| <code>number</code> | <code>1</code> | Helix Api version to be sent as `X-HELIX-API-Version` header. |
| [settings.requestBatchSize] | <code>number</code> | <code>1000</code> | Number of search values per request. |

<a name="module_http-client..createHttpClient"></a>

### *http-client*~createHttpClient([settings])

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| [settings] | <code>object</code> | <code>{}</code> |  |
| [settings.provider] | <code>string</code> | <code>&quot;http://localhost:14265&quot;</code> | Uri of helix node |
| [settings.timeout] | <code>number</code> | <code></code> | Timeout |
| [settings.apiVersion] | <code>string</code> \| <code>number</code> | <code>1</code> | Helix Api version to be sent as `X-HELIX-API-Version` header. |
| [settings.requestBatchSize] | <code>number</code> | <code>1000</code> | Number of search values per request. |

Create an http client to access helix http API.

**Returns**: Object

---
_Source: https://npm.io/package/@helixnetwork/http-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
