# rest-proxy

> is a simple REST API client

Latest version **0.0.9** (published 2017-12-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install rest-proxy
pnpm add rest-proxy
yarn add rest-proxy
bun add rest-proxy
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.9 |
| Published | 2017-12-18 |
| First published | 2016-11-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Aleksandar Orlic |
| Maintainers | aorlic |

## Links

- npm: https://www.npmjs.com/package/rest-proxy
- npm.io page: https://npm.io/package/rest-proxy

## Dependencies (2)

- [request](https://npm.io/package/request.md) ^2.75.0
- [url-template](https://npm.io/package/url-template.md) ^2.0.8

## Recent versions

- 0.0.9 (latest) — 2017-12-18
- 0.0.8 — 2017-12-18
- 0.0.7 — 2017-10-27
- 0.0.6 — 2017-08-17
- 0.0.5 — 2017-06-24
- 0.0.4 — 2017-04-24
- 0.0.3 — 2017-04-24
- 0.0.2 — 2017-04-03
- 0.0.1 — 2016-11-07

## README

# rest-proxy
is a simple REST API client

## install

```sh
$ npm install rest-proxy
```

## use

```js
// require nad configure the proxy
var my-api = require('rest-proxy').create({
    baseUrl:            "example.com/api/",
    isSSL:              true,
    authentication: {
        type: "basic",
        defaultCredentials: {
            user:       "admin-user",
            password:   "admin-pass"
        }
    }, 
    services: {
        getMyResources: {
          method: "get",
          url: "myresources",
          success: 200
        },
        getMyresourceById: {
          method: "get",
          url: "myresources/{id}",
          success: 200
        }
    }
});


// call a service (in this case GET example.com/api/myresources/101)
my-api.invoke("getMyresourceById", {id:101}, null, function(err, res_body, res_details) {
    // do something with the received data
});

```

##license
ISC

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