POST请求
var url = "http://ip地址:8080/test/?id=26323";
var params = {"billIds":["56141305725718528"],"billType":"VBNSC"};
var xhr = new XMLHttpRequest();
("POST", url, true);
("Content-Type", "application/json");
= function (e) {
if ( === 4) {
if ( === 200) {
();
} else {
();
}
}
};
((params));
= function (e) {
();
};
GET请求
var url = "http://IP:8080/testGet?id=235";
var xhr = new XMLHttpRequest();
("GET", url, true);
// ("Content-Type", "application/json");
= function (e) {
if ( === 4) {
if ( === 200) {
();
} else {
();
}
}
};
();
= function (e) {
();
};
相关文章
- chrome 模拟发送POST请求和GET请求
- 转:PHP中的使用curl发送请求(GET请求和POST请求)
- 使用Postman模拟发送get、post、delete、put请求
- Linux系统模拟发送HTTP的get和post请求
- HttpClient 模拟发送Post和Get请求 并用fastjson对返回json字符串数据解析,和HttpClient一些参数方法的deprecated(弃用)的综合总结
- jQuery ajax post在ipad chrome上使用get方法发送请求
- PHP中的使用curl发送请求(GET请求和POST请求)
- 使用ApiPost模拟发送get、post、delete、put等http请求
- java使用HttpClient模拟发送http的get、post请求
- Java后台模拟发送http的get和post请求,并测试