【问题标题】:Using curl to make ajax call使用 curl 进行 ajax 调用
【发布时间】:2016-04-21 15:33:06
【问题描述】:
curl -X DELETE https://www.filestackapi.com/api/file/**HANDLE**?key=APIKEY

我想使用上面的 curl 调用从文件堆栈存储中删除一个文件。如何在使用 jQuery 或 SuperAgent 的 ajax 调用中使用它?

【问题讨论】:

    标签: jquery rest curl superagent


    【解决方案1】:

    使用 jQuery:

    $.ajax({
        url: 'https://www.filestackapi.com/api/file/HANDLE?key=APIKEY',
        type: 'DELETE',
        success: function(result) {
            // Do something with the result
        }
    });
    

    使用超级代理

    request
      .del('https://www.filestackapi.com/api/file/HANDLE?key=APIKEY')
      .end(function(err, res){
    
      });
    

    【讨论】:

      猜你喜欢
      • 2021-02-28
      • 1970-01-01
      • 2017-02-09
      • 2015-07-22
      • 2016-09-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-31
      相关资源
      最近更新 更多