request/Readme.md

34 lines
590 B
Markdown

![downloads](https://img.shields.io/npm/dt/@gm5/request.svg)
![version](https://img.shields.io/npm/v/@gm5/request.svg)
# @gm5/equest
> 对Http的request进一步封装, 提供常用的API.
## Install
```bash
npm i @gm5/request
```
## Usage
```javascript
import Request from '@gm5/request'
import http from 'http'
http
.createServer((req, res) => {
let request = new Request(req, res)
// print the fixed url
console.log(request.url)
request.ip // get client ip address
// http://test.com/?foo=bar
request.query['foo'] // bar
})
.listen(3000)
```
对Http的request进一步封装, 提供常用的API
JavaScript 100%