# qiao-request

> nodejs http request client

Latest version **3.2.3** (published 2024-12-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install qiao-request
pnpm add qiao-request
yarn add qiao-request
bun add qiao-request
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

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

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.2.3 |
| Published | 2024-12-04 |
| First published | 2022-05-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 17.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | uikoo9 |
| Maintainers | npm_insistime |
| Keywords | nodejs, http, request, ping, imcp |

## Links

- npm: https://www.npmjs.com/package/qiao-request
- Repository: https://github.com/uikoo9/qiao-monorepo
- Homepage: https://code.vincentqiao.com/#qiao-request
- Issues: https://github.com/uikoo9/qiao-monorepo/issues
- npm.io page: https://npm.io/package/qiao-request

## Dependencies (1)

- [qiao.plugin.requestfix](https://npm.io/package/qiao.plugin.requestfix.md) ^2.88.99

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 3.2.3 (latest) — 2024-12-04
- 3.2.0 — 2024-02-17
- 3.1.1 — 2023-06-13
- 3.0.5 — 2023-05-18
- 3.0.1 — 2023-04-18
- 0.4.5 — 2023-02-01
- 0.4.4 — 2023-01-05
- 0.4.2 — 2022-11-30
- 0.4.1 — 2022-11-29
- 0.4.0 — 2022-09-29
- 0.3.9 — 2022-06-01
- 0.3.8 — 2022-05-24
- 0.3.7 — 2022-05-21
- 0.3.6 — 2022-05-18
- 0.3.5 — 2022-05-17
- … 4 more at https://npm.io/package/qiao-request/versions

## README

# qiao-request

## api

### getSync

```javascript
'use strict';

var q = require('qiao-request');

var test = async function () {
  try {
    var url = 'http://www.baidu.com';
    var res = await q.getSync({
      url: url,
      qs: {
        test: 'test',
      },
    });

    console.log(res);
  } catch (e) {
    console.log(e);
  }
};

test();
```

### postSync

```javascript
'use strict';

var q = require('qiao-request');

var test = async function () {
  try {
    var url = 'http://www.baidu.com';
    var res = await q.postSync({
      url: url,
      qs: {
        test: 'test',
      },
    });

    console.log(res);
  } catch (e) {
    console.log(e);
  }
};

test();
```

### putSync

```javascript
'use strict';

var q = require('qiao-request');

var test = async function () {
  try {
    var url = 'http://10.33.12.68:8002/put';
    var res = await q.putSync({
      url: url,
    });

    console.log(res);
  } catch (e) {
    console.log(e);
  }
};

test();
```

### patchSync

```javascript
'use strict';

var q = require('qiao-request');

var test = async function () {
  try {
    var url = 'http://10.33.12.68:8002/patch';
    var res = await q.patchSync({
      url: url,
    });

    console.log(res);
  } catch (e) {
    console.log(e);
  }
};

test();
```

### deleteSync

```javascript
'use strict';

var q = require('qiao-request');

var test = async function () {
  try {
    var url = 'http://10.33.12.68:8002/delete';
    var res = await q.deleteSync({
      url: url,
    });

    console.log(res);
  } catch (e) {
    console.log(e);
  }
};

test();
```

### headSync

```javascript
'use strict';

var q = require('qiao-request');

var test = async function () {
  try {
    var url = 'http://10.33.12.68:8002/head';
    var res = await q.headSync({
      url: url,
    });

    console.log(res);
  } catch (e) {
    console.log(e);
  }
};

test();
```

### optionsSync

```javascript
'use strict';

var q = require('qiao-request');

var test = async function () {
  try {
    var url = 'http://10.33.12.68:8002/options';
    var res = await q.optionsSync({
      url: url,
    });

    console.log(res);
  } catch (e) {
    console.log(e);
  }
};

test();
```

### get

```javascript
'use strict';

var q = require('qiao-request');

var test = function () {
  var url = 'http://www.baidu.com';
  q.get(
    {
      url: url,
      qs: {
        test: 'test',
      },
    },
    function (err, rs, body) {
      console.log(err, body);
    },
  );
};

test();
```

### post

```javascript
'use strict';

var q = require('qiao-request');

var test = function () {
  var url = 'http://www.baidu.com';
  q.post(
    {
      url: url,
      qs: {
        test: 'test',
      },
    },
    function (err, rs, body) {
      console.log(err, body);
    },
  );
};

test();
```

### put

```javascript
'use strict';

var q = require('qiao-request');

var test = function () {
  var url = 'http://10.33.12.68:8002/put';
  q.put(
    {
      url: url,
    },
    function (err, rs, body) {
      console.log(err, body);
    },
  );
};

test();
```

### patch

```javascript
'use strict';

var q = require('qiao-request');

var test = function () {
  var url = 'http://10.33.12.68:8002/patch';
  q.patch(
    {
      url: url,
    },
    function (err, rs, body) {
      console.log(err, body);
    },
  );
};

test();
```

### delete

```javascript
'use strict';

var q = require('qiao-request');

var test = function () {
  var url = 'http://10.33.12.68:8002/delete';
  q.delete(
    {
      url: url,
    },
    function (err, rs, body) {
      console.log(err, body);
    },
  );
};

test();
```

### head

```javascript
'use strict';

var q = require('qiao-request');

var test = function () {
  var url = 'http://10.33.12.68:8002/head';
  q.head(
    {
      url: url,
    },
    function (err, rs, body) {
      console.log(err, rs.headers);
    },
  );
};

test();
```

### options

```javascript
'use strict';

var q = require('qiao-request');

var test = function () {
  var url = 'http://10.33.12.68:8002/options';
  q.options(
    {
      url: url,
    },
    function (err, rs, body) {
      console.log(err, body);
    },
  );
};

test();
```

### download

```javascript
'use strict';

var q = require('qiao-request');

var test = async function () {
  try {
    var url = 'https://www.baidu.com/img/bd_logo1.png';
    var path = 'd:/test.png';

    await q.download(url, path);
  } catch (e) {
    console.log(e);
  }
};

test();
```

### imgToBase64

```javascript
'use strict';

var q = require('qiao-request');

var test = function () {
  var url = 'https://www.baidu.com/img/baidu_resultlogo@2.png';
  q.imgToBase64(url, function (res) {
    console.log(res);
  });
};

test();
```

### imgToBase64Sync

```javascript
'use strict';

var q = require('qiao-request');

var test = async function () {
  try {
    var url = 'https://www.baidu.com/img/baidu_resultlogo@2.png';
    var res = await q.imgToBase64Sync(url);
    console.log(res);
  } catch (e) {
    console.log(e);
  }
};

test();
```

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