1.1.0 • Published 9 years ago

superagent-promise v1.1.0

Weekly downloads
17,274
License
MIT
Repository
github
Last release
9 years ago

Build Status

superagent-promise

Simple/dumb promise wrapper for superagent. You must depend on superagent and your favorite Promise library directly.

Usage

var Promise = this.Promise || require('promise');
var agent = require('superagent-promise')(require('superagent'), Promise);

// method, url form with `end`
agent('GET', 'http://google.com')
  .end()
  .then(function onResult(res) {
    // do stuff
  }, function onError(err) {
    //err.response has the response from the server
  });

// method, url form with `then`
agent('GET', 'http://google.com')
  .then(function onResult(res) {
    // do stuff
  });


// helper functions: options, head, get, post, put, patch, del
agent.put('http://myxfoo', 'data')
  .end()
  .then(function(res) {
    // do stuff`
  });

// helper functions: options, head, get, post, put, patch, del
agent.put('http://myxfoo', 'data').
  .then(function(res) {
    // do stuff
  });
bambuser-cdn-client-jswps-driver-reacttm-leit@infinitebrahmanuniverse/nolb-supera@everything-registry/sub-chunk-2850taskcluster-lib-statstaskcluster-vcssync-dbvz-trainvz-dockerinoweevaluate-sdkwp-checkerwgo-desafiosuper-sirensuperagent-promise-no-cachesparql-fetch-labeltestdroid-clientswapi-node-exercisetfl.apitidal-api@dolnpm/agent@caiproject/sapcai@buyerassist/dazn-lambda-powertools-http-clientizara-powertools-http-clientjirikara-chat-framekara-contactkara-uckara-module-file-listkarauikijiji-posterstrike-apitwo-way-resttrafficjunkytrello-browsertreenotetopdomains-reddit@atexto/atexto-sdk@axa-ch/pod-redirect@axa-ch/pod-customer-review@dazn/lambda-powertools-http-clientyappywebpackforcommonzeropark@hardfist/realworld@michaelfecher/lambda-powertools-http-client@munkyjunky/healthgraphql@izara_project/izara-middleware@jflorezg/sapcaicf@kmihaltsov/lambda-powertools-http-client@signalk/signalk-clientmozilla-treeherderopenprovideroijoijoada-app-cachepapertrailsamplereactcompraptor-testrung-clirw-xsm-handlerssapcaireact-left-slide-deletesammler-scheduler-servicesammler-strategy-githubsamman-authreactjs-pull-loadregistry-validatorschema-validator-publishersend-smsniwodai-clientnjp-tagnezha-clinodeogramplugin-spacepopadsrest-api-starterreploy-clirequest-oncequintype-maliburandom-auditsridibooksrecastairestcoder-clireact-rest-form-editorreact-restuireact-restful-tablereact-redux-realworld-example-appreact-redux-realworld-example-app-frontendsignalk-tides-apisms-feshelf-libsignalk-aishub-wssignalk-clientslack-microbotssignalk-marinetraffic-apigraphene-marionette-runnerhuman-guitarhapi-taskcluster-apiinnotech-bypayinnotech-pingan
1.1.0

9 years ago

1.0.3

10 years ago

1.0.0

10 years ago

0.2.0

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.0

11 years ago