Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vbrazo/erlang_api_client
Erlang REST Client API
https://github.com/vbrazo/erlang_api_client
api client erlang
Last synced: 21 days ago
JSON representation
Erlang REST Client API
- Host: GitHub
- URL: https://github.com/vbrazo/erlang_api_client
- Owner: vbrazo
- Created: 2021-08-26T22:11:43.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-27T22:45:04.000Z (over 3 years ago)
- Last Synced: 2024-11-24T21:28:12.085Z (3 months ago)
- Topics: api, client, erlang
- Language: Erlang
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Erlang API Client
Erlang API Client using [Hackney](https://github.com/benoitc/hackney/) HTTP Client.
## Dependencies
* Erlang (>= R18)
* [rebar3](https://github.com/erlang/rebar3)
* [rebar3_format](https://github.com/AdRoll/rebar3_format)## Running application
```erlang
1> application:start(api_client)
```## Run locally
```bash
$ ./bin/start.sh
```## Usage
First you have to set the `API KEY` for your API.
```erlang
1> eac:set_api_key(<<"YOUR API KEY">>).=INFO REPORT==== 13-May-2016::20:14:34 ===
set_api_key - <<"YOUR API KEY">>
ok2> eac:algo(<<"demo/Hello/0.1.1">>, <<"HAL 9000">>, text).
=INFO REPORT==== 13-May-2016::20:14:40 ===
[API] URI=https://api.datafit.com/v1/demo/Hello/0.1.1
{ok,#{<<"metadata">> => #{<<"content_type">> => <<"text">>,
<<"duration">> => 0.001761989},
<<"result">> => <<"Hello HAL 9000">>}}
```You can pass additional [Hackney HTTP Client options](https://github.com/benoitc/hackney/blob/master/doc/hackney.md#request-4). By default `pool` option is used.
## Testing
- To run all tests use `rebar3 eunit`.
- To see test coverage `rebar3 cover`.