# ml-http

> The http package for Microlattice.js

Latest version **0.0.4** (published 2017-04-08) · Apache2 license · 0 weekly downloads

## Install

```sh
npm install ml-http
pnpm add ml-http
yarn add ml-http
bun add ml-http
```

## 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.4 |
| Published | 2017-04-08 |
| First published | 2016-04-13 |
| Weekly downloads | 0 |
| License | Apache2 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | iamblue |
| Maintainers | iamblue |

## Links

- npm: https://www.npmjs.com/package/ml-http
- npm.io page: https://npm.io/package/ml-http

## Recent versions

- 0.0.4 (latest) — 2017-04-08
- 0.0.3 — 2016-08-22
- 0.0.2 — 2016-08-09
- 0.0.1 — 2016-04-13

## README

# ml-http

## API

``` js

/* get api */

__http({
  method: 'GET' // string
  url:    //string
  header: // string, default please set: '\r\n'
}, function(data) {
  // callback function
});

/* post api */

__http({
  url: // string,
  method: 'POST' // string,
  header: // string, default please set: '\r\n'
  contentType: // string,
  data: // string, please sent json format
}, function(data) {
  // callback function
});

```

## Example

``` js
/* get api */
  var config = {
    method: 'GET',
    url: 'http://apis.map.qq.com/ws/location/v1/ip?ip=61.135.17.68&key=6MABZ-VFKAF-DITJ6-JRPZN-OUOFJ-ULBWQ',
    header: '\r\n',
  };

  __http(config, function(data) {
    print(data);
    var i = JSON.parse(data);
    print('status:' + i.status);
  });

/* post api */
  var data = { a: 123 };
  var config = {
    url: "http://",
    method: "POST",
    header: "deviceKey:123123\r\n";,
    contentType: "application/json",
    data: JSON.stringify(data),
  }

  __http(config, function(data) {
    print('data: '+ data);
  });


```

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