yutent 9d66a77b4d 增加hostname 2023-11-01 14:19:00 +08:00
lib 优化content-type判断;增加protocol属性 2023-10-31 14:28:15 +08:00
.gitignore 完成2.0版重构 2023-10-30 16:41:37 +08:00
LICENSE init 2020-09-16 20:07:28 +08:00
Readme.md 更新readme 2023-10-30 17:34:06 +08:00
index.js 增加hostname 2023-11-01 14:19:00 +08:00
package.json 增加hostname 2023-11-01 14:19:00 +08:00

Readme.md

downloads version

@gm5/equest

对Http的request进一步封装, 提供常用的API.

Install

    npm i @gm5/request

Usage

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%