- 浏览: 57234 次
- 性别:
- 来自: 广州
最新评论
-
Joson_Coney:
11.
while( (*strDest++ = *strSr ...
c++笔试题汇总 -
Joson_Coney:
③ 1.
int func(x)
{
int countx = ...
c++笔试题汇总 -
Joson_Coney:
链表反向1:
#include <cstdlib&g ...
c++笔试题汇总
HTTP Request
Published in: JavaScript
Generic global code for managing XMLHttpRequest objects.
Expand | Embed | Plain Text
-
// ----------------------------------------
-
// Wrapper function for constructing a request object.
-
// Parameters:
-
// reqType: The HTTP request type, such as GET or POST.
-
// url: The URL of the server program.
-
// asynch: Whether to send the request asynchronously or not.
-
// ----------------------------------------
-
-
function httpRequest(reqType,url,asynch) {
-
-
// Mozilla-based browsers
-
if (window.XMLHttpRequest) {
-
request = new XMLHttpRequest();
-
} else if (window.ActiveXObject) {
-
request = new ActiveXObject("Msxml2.XMLHTTP");
-
if (!request) {
-
request = new ActiveXObject("Microsoft.XMLHTTP");
-
}
-
}
-
-
// Request could still be null if neither ActiveXObject
-
// initialization succeeded
-
if (request) {
-
// If the reqType param is POST, then the fifth arg is the POSTed data
-
if (reqType.toLowerCase() != "post") {
-
initReq(reqType, url, asynch, respHandle);
-
} else {
-
// The POSTed data
-
var args = arguments[4];
-
if (args != null && args.length > 0) {
-
initReq(reqType, url, asynch, respHandle, args);
-
}
-
}
-
} else {
-
alert("Your browser does not permit the use of all " +
-
"of this application's features!");
-
}
-
-
}
-
-
// ----------------------------------------
-
// Initialize a request object that is already constructed
-
// ----------------------------------------
-
-
function initReq(reqType, url, bool, respHandle) {
-
try {
-
// Specify the function that will handle the HTTP response
-
request.onreadystatechange = handleResponse;
-
request.open(reqType, url, bool);
-
// If the reqType param is POST, then the
-
// fifth argument to the function is the POSTed data
-
if (reqType.toLowerCase() == "post") {
-
// Set the Content-Type header for a POST request
-
request.setRequestHeader("Content-Type", "application/x-ww-form-urlencoded; charset=UTF-8");
-
request.send(arguments[4]);
-
} else {
-
request.send(null);
-
}
-
} catch (errv) {
-
alert("The application cannot contact the server at the moment. " +
-
"Please try again in a few seconds.\n" +
-
"Error detail: " errv.message);
-
}
-
}
发表评论
-
【转】DNS协议报文(RFC1035)
2012-01-27 06:46 1333(转自:http://hi.baidu. ... -
【转】Protocol Header Images
2012-01-27 06:45 658http://www.troyjessup.com/heade ... -
【转】DNS协议及应用
2012-01-27 06:44 942(转自http://jwx.zgz.cn/cl/7 ... -
DNS 伺服器
2012-01-26 06:03 530DNS 伺服器http://linux.vbird.org/l ... -
HTTP multipart/form-data 上传方式说明
2012-01-26 06:01 865( From: http://home.meegoq.c ... -
Struts2源码分析--请求处理
2011-12-01 10:03 649(转自:http://www.blogjava.ne ... -
java web学习笔记
2011-11-21 09:50 590Tomcat Configuration 资 ... -
[转] HTTP multipart/form-data 上传方式说明
2011-10-15 06:08 1311( From: http://home.meegoq.co ... -
Multipart uploading spec
2011-10-15 06:07 677Upload File: abc.txtContent:abc ... -
【转】Webcam Manipulation with Javascript
2011-10-15 06:04 805( From:http://blog.trumpton.org ... -
Table单元格td的position:relative的兼容性
2011-10-11 12:35 1913( From: http://www.itref.cn/a/ ... -
a lib: jXHR (JSON-P XHR)
2011-10-11 12:18 701http://mulletxhr.com/ -
Remote JSON - JSONP
2011-10-11 12:16 695( From : http://bob.pythonmac.o ... -
cross-domain资源
2011-10-07 01:32 604发现一个网站,没来得及细看,留个网址:http://www.c ... -
Single Sign-On
2011-10-07 01:25 615Single Sign-On Single sign-on ... -
HTTP multipart/form-data 上传方式说明
2011-10-07 01:23 784HTTP multipart/form-data 上传方式 ... -
【转】HTTP协议报文格式
2011-10-07 01:21 683(From: http://book.51cto.com/ar ... -
Relying on DOM readiness to invoke a function (instead of window.onload)
2011-10-06 06:45 607( From: http://www.javascriptki ... -
【转】Calling Cross Domain Web Services in AJAX
2011-10-06 06:41 745(From: http://www.simple-talk ... -
Which browsers support HTML5, CSS3, Data URLs, etc.
2011-10-06 06:38 639http://caniuse.com/#
相关推荐
HTTP Request Editor是一款强大的工具,专为开发者和网络爱好者设计,用于HTTP抓包和编辑。它允许用户捕获、查看并修改HTTP请求,这对于调试Web应用、理解网络通信过程以及优化API交互具有极大的价值。 首先,我们...
IBM Rational HTTP Request Editor 是一款强大的工具,主要用于调试和构建HTTP请求。它允许用户直观地创建、编辑和发送HTTP请求,并查看响应数据,是IT专业人员进行Web服务测试和API调试时的重要助手。以下是对该...
Node-RED用http request实现收发
SendHTTPRequest 我需要的东西
一个好用的HTTP REQUEST 调试工具 http request
oracle 范文http request接口获取XML,创建表并把样例结果入库 <?xml version="1.0" encoding="utf-8"?> <linked-hash-map> <string>name 字段名称 <string>alias 中文备注 ...
SendHTTPRequest 我需要的代码
Using it, you can easily create an asynchronous HTTP request and receive event callback. It can be applied to MFC and ATL projects. This code mainly consists of two classes: class FCHttpRequest and ...
在“Laravel开发-guzzle-http-request”项目中,`ghr`(可能代表Guzzle HTTP Request的简写)是一个专门针对Guzzle的轻量级包装器,旨在进一步提升在Laravel应用中的使用体验,特别是在处理多个并发请求和DOM解析...
Apache JMeter是Apache组织开发的基于Java的压力测试工具。用于对软件做压力测试,它最初被设计用于Web应用测试,但后来扩展到其他测试领域。
"JAVA HTTP Request"的主题涵盖了如何在Java中发送HTTP请求,这通常是通过使用内置的`java.net.URL`、`java.net.HttpURLConnection`类或者第三方库如Apache HttpClient、OkHttp来实现的。下面我们将深入探讨这些方法...
标题中的"The plain HTTP request was sent to HTTPS port"错误在Nginx服务器配置中是一个常见的问题,通常发生在尝试通过HTTPS(安全的HTTP协议)访问网站时,但Nginx却接收到一个非加密的HTTP请求。这通常是由于...
在使用Jenkins时经常需要通过http请求去操作service API。其中HTTP Request Plugin插件就可以满足。
2020-02-19 10:34:46.901 INFO 5920 --- [nio-8080-exec-1] o.apache.coyote.http11.Http11Processor : Error parsing HTTP request header Note: further occurrences of HTTP header parsing errors will be ...
当使用php5自带的file_get_contents方法来获取远程文件的时候,有时候会出现file_get_contents(): failed to open stream: HTTP request failed!这个警告信息。
在Laravel框架中,HTTP Request服务是核心组件之一,它为开发者提供了处理HTTP请求的强大工具。这个主题“Laravel开发-laravel-http-request-service”聚焦于如何有效地利用Laravel中的HttpRequest服务来增强应用的...
在本"Jmeter Java Request Demo"项目中,我们将会深入探讨如何利用JMeter进行Java请求,包括TCP、HTTP以及RocketMQ这三种不同类型的网络通信。 首先,让我们了解一下Java Request在JMeter中的应用。Java Request是...