1 | function post(url, param, header, callback) {
|
2 | let request = require('request');
|
3 | header['Content-Type'] = 'application/x-www-form-urlencoded';
|
4 | let options = {
|
5 | method: 'post',
|
6 | url: url,
|
7 | form: param,
|
8 | headers: header
|
9 | };
|
10 |
|
11 | request(options, function (err, res, body) {
|
12 | if (err) {
|
13 | callback(err)
|
14 | } else {
|
15 | callback(body)
|
16 | }
|
17 | })
|
18 | }
|
19 |
|
20 | module.exports = {post}; |
\ | No newline at end of file |