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
}
)
;
查看全文
相关阅读:
html,css,js实现的一个钟表
CSS子元素在父元素中水平垂直居中的几种方法
JavaScript去除字符串中的空格
JavaScript判断数据类型的4中方法
数据库的创建和删除
MySql数据类型及对应存储空间
配置hibernate常见问题
java 获取系统变量(环境变量和设置变量)
IDEA创建Web项目(基于Maven多模块)
spring boot快速搭建
原文地址:https://www.cnblogs.com/Gbeniot/p/7326357.html
最新文章
mysql 5.7 安装教程
logback-记录日志
git vs sourcetree
关于使用idea的一些小技巧
Java Serializable(序列化)的理解和总结
Spring中的用到的设计模式
Java并发之CountDownLatch
Java并发编程的3个特性
java并发之TimeUnit理解
Nexus 私有仓库
热门文章
集训队作业2018: 青春猪头少年不会梦到兔女郎学姐
AGC 046 部分简要题解
SCOI 2020 被场虐记
Loj #6363. 「地底蔷薇」
AGC 045 部分简要题解
Codechef April Challenge 2020
UR #19 简要题解
Codeforces 1322 F : Assigning Fares
jsonp原理详解
Manjaro XFCE 设置分辨率1920*1080
Copyright © 2011-2022 走看看