1.1.1 • Published 6 years ago

ykt-http-client v1.1.1

Weekly downloads
4
License
ISC
Repository
github
Last release
6 years ago

使用HTTP连接远程服务器接口

使用方法

1. 导入http-client模块

const hc = require("ykt-http-client");

2. 发送get请求

    //不带参数
    hc.get("localhost:8080/users/show").then(function(data){
        //data为远程服务器返回的数据
    });
    //带请求参数
    hc.get("localhost:8080/users/show",{phone:phone}).then(function(data){
        //data为远程服务器返回的数据
    });

3. 发送post请求

    //不带参数
    hc.post("localhost:8080/users/show").then(function(data){
        //data为远程服务器返回的数据
    });
    //带请求参数
    hc.post("localhost:8080/users/show",{phone:phone}).then(function(data){
        //data为远程服务器返回的数据
    });
1.1.1

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

7 years ago