MCPcopy Create free account
hub / github.com/3075426724/PowerTennis / https

Function https

cloudfunctions/cloud/framework/lib/http_lib.js:9–29  ·  view source on GitHub ↗
(url, postData)

Source from the content-addressed store, hash-verified

7const util = require('../utils/util.js');
8
9function https(url, postData) {
10 var request = require('request');
11 return new Promise(function (resolve, reject) {
12
13 request.post(url, {
14 form: postData
15 },
16 function (error, response, body) {
17 console.log('[BODY]' + body);
18 if (!error && response.statusCode == 200) {
19 let json = JSON.parse(body);
20 resolve(json);
21 } else {
22 console.error('https error', error || response.statusCode);
23 reject(error || response.statusCode);
24 }
25 }
26 );
27 });
28
29}
30// 同步方法
31function post({
32 host,

Callers

nothing calls this directly

Calls 2

logMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected