How to use the default function from superagent

Find comprehensive JavaScript superagent.default code examples handpicked from public code repositorys.

1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
  "params": _params
};
// console.log('PKG', pkg)

/* Request Elasticsearch query. */
response = await _superagent.default.post(endpoint).set('accept', 'json').send(pkg).catch(_err => {
  // console.error(_err)

  if (_err && _err.response && _err.response.text) {
    error = JSON.parse(_err.response.text);
fork icon1
star icon4
watch icon1

+ 4 other calls in file

17
18
19
20
21
22
23
24
25
26
    this.token = token;
}
getRequest(method, url) {
    switch (method.toUpperCase()) {
        case 'GET':
            return superagent_1.default.get(url);
        case 'POST':
            return superagent_1.default.post(url);
        case 'PUT':
            return superagent_1.default.put(url);
fork icon0
star icon0
watch icon1

+ 109 other calls in file