TYT的网站

postman发送json格式的post请求

2017-09-25 14:57 工具· 点击 1010

1054166-20161123124714034-1785548866.png


相当于代码如下:

needle = require(‘needle’);
    LOGIN_URL = ‘xxxxx’;
    var data = ‘{“username”: “username”,“password”: “password”}’;
    var options = {headers: { ‘Content-Type’: ‘application/json’ }};
    needle.post(LOGIN_URL, data, options, function(err, resp) {
    console.log(resp);
});


返回列表
浏览 新增 设置