zoukankan      html  css  js  c++  java
  • superagent-promise

    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 
      });
  • 相关阅读:
    Eclipse快捷键
    LeeCode
    Code Complete
    Git
    sql优化策略
    FSA/FSM/FST
    索引失效情况
    实现HttpHandlerFactory的方法
    Xpath语法格式整理
    Edojs应用
  • 原文地址:https://www.cnblogs.com/Gbeniot/p/7326357.html
Copyright © 2011-2022 走看看