How to use the postAsync function from request

Find comprehensive JavaScript request.postAsync code examples handpicked from public code repositorys.

100
101
102
103
104
105
106
107
108
109
    },
    //proxy: 'http://127.0.0.1:8888',
    strictSSL: false,
    jar: getTokenJar
};
return request.postAsync(loginOption).then((res)=> {
    let token = {cookies: getTokenJar.getCookieString(baiduUri)};
    this.setToken(token);
    return;
});
fork icon61
star icon157
watch icon21

+ 3 other calls in file

2
3
4
5
6
7
8
9
10
11
const xhr = bluebird.promisifyAll(require('request'));

const { ChatLog, GifCache } = require('./storage');

async function findGif(keywords) {
    const gifResp = await xhr.postAsync('https://rightgif.com/search/web', {
        form: {
            text: keywords
        }
    });
fork icon51
star icon421
watch icon13

+ 5 other calls in file

29
30
31
32
33
34
35
36
37
38
  }
} catch (error) {
  return reject(error)
}

requestPromise.postAsync(options)
  .then(function (response) {
    return resolve(response)
  })
  .catch(function (error) {
fork icon5
star icon7
watch icon4

131
132
133
134
135
136
137
138
139
140
          options: 
           { filename: params.fileName,
             contentType: null } } }
}

return _Request.postAsync({
    url: `${apiurl}/Breakdowns`,
    qs: params,
    headers: {  
        "Content-Type": "multipart/form-data",
fork icon4
star icon24
watch icon6

15
16
17
18
19
20
21
22
23
24
    this.reqobj.url += '/'+sysid;
    return request.getAsync(this.reqobj).then(plogic);
};
ImportSet.prototype.insert = function(obj) {
    this.reqobj.body = obj
    return request.postAsync(this.reqobj).then(plogic);
};


return ImportSet;
fork icon12
star icon17
watch icon3

19
20
21
22
23
24
25
26
27
28

function register (url) {
  return async function () {
    const serverId = await getServerId()
    try {
      await request.postAsync(url, {
        json: true,
        form: {
          id: serverId,
          os: {
fork icon10
star icon22
watch icon4

114
115
116
117
118
119
120
121
122
123
var Promise = require('bluebird');
var request = Promise.promisifyAll(require('request'));

// create ajax function for sending requests
var ajax = function(param) {
    return request.postAsync(param.url, {
        json: true,
        form: param.data,
    }).then(function(res) {
        return new Promise(function(resolve) {
fork icon5
star icon28
watch icon16

30
31
32
33
34
35
36
37
38
39
_get(props) {
    return request.getAsync(_.extend(this.props, props));
}

_post(props) {
    return request.postAsync(_.extend(this.props, props));
}

getBalance() {
    return this._get({
fork icon0
star icon2
watch icon2