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
}
)
;
查看全文
相关阅读:
加工零件(Dijkstra)
尼克的任务(DP)
挖地雷(记忆化搜索)
滑雪(DP,记忆化搜索)
子串和子序列(DP)
八皇后(DFS)
打印feign报错日志
restTemplate 踩坑
共享全局对象
获取当月多少天
原文地址:https://www.cnblogs.com/Gbeniot/p/7326357.html
最新文章
Redis数据库 专题
Java 线程池专题
Java MySQL数据库专题
Java垃圾回收(GC)机制专题
Java面试高频知识点汇总 网络协议专题
Lightoj1253(博弈+NIM)
hdu1160 FatMouse's Speed
poj1328
hdu1251 字典树
poj2352 Stars
热门文章
hdu 1358 Period
hdu1078 FatMouse and Cheese (记忆化搜索)
HDU3047-Zjnu Stadium(加权并查集)
Fence Repair 栅栏分割
poj3255 Roadblocks (次短路)
小笔记
Grazing2 S(DP)
旅行家的预算(单调队列)
神经网络(拓扑排序)
计算器的改良(模拟)
Copyright © 2011-2022 走看看