用idhttp发送post的时候,提示HTTP/1.1 401 Unauthorized [问题点数:100分,结帖人yanghaiyanghai]

Bbs1
本版专家分:0
结帖率 92.31%
Bbs2
本版专家分:400
网络协议学习——HTTP协议POST方法的格式
关于<em>http</em>的介绍这不赘述,主要总结下<em>post</em>方法里不同形式的body的提交格式。先谈谈get与<em>post</em>的区别很多人说get方法比<em>post</em>方法安全,我本人并不赞同,这是个片面的说法。在本地环境下,<em>post</em>的参数通常不会保存在浏览器历史里,在提交请求时,get方法的参数直接放在URL上,而<em>post</em>方法则是放在body里,相比于get,<em>post</em>不能直接看到所提交的参数。 想象一下,如果提交的密码是一个
如何使用SOCKET 发送HTTP1.1 GET POST请求包
如何使用SOCKET <em>发送</em>HTTP<em>1.1</em> GET POST请求包HTTP报文是面向文本的,报文中的每一个字段都是一些ASCII码串,各个字段的长度是不确定的。HTTP有两类报文:请求报文和响应报文。请求报文一个HTTP请求报文由请求行(request line)、请求头部(header)、空行和请求数据4个部分组成,下图给出了请求报文的一般格式。 (1)请求行请
HTTP/1.1协议(一)—— 概述及请求方法
一、概述   谈起HTTP协议(超文本传输协议),首先要知道计算机网络的五层协议体系结构(综合了OSI和TCP/IP体系结构的优点),从上层一直到下层分别为:应用层、传输层、网络层、数据链路层、物理层。每一层都有对应的协议,以保证计算机之间能在网络中通信。而HTTP协议则是工作在应用层,为用户浏览Web页面提供支持。这里以一张图来简要说明浏览一个Web页面的过程。 整个过程可以这样概述:域...
四种常见的 POST 提交数据方式
四种常见的 POST 提交数据方式 文章目录 application/x-www-form-urlencoded multipart/form-data application/json text/xml HTTP/<em>1.1</em> 协议规定的 HTTP 请求方法有 OPTIONS、GET、HEAD、POST、PUT、DELETE、TR
nova command:Unauthorized (HTTP 401)
nova-api.logrnrn[code=text]rn2013-12-12 06:47:29.192 4773 INFO nova.osapi_compute.wsgi.server [-] 192.168.56.122 "GET /v2/662defab998e4ce78c35fce07543c90e/servers/detail HTTP/<em>1.1</em>" status: <em>401</em> len: 465 time: 0.0419970rnrn[/code]rnrnapi-paste.inirn[code=text]rn[filter:authtoken]rnpaste.filter_factory = keystoneclient.middleware.auth_token:filter_factoryrnauth_host = 192.168.<em>1.1</em>55rnauth_port = 35357rnauth_protocol = <em>http</em>rnadmin_tenant_name = servicernadmin_user = novarnadmin_password = service_passrnauth_version = v2.0rnrn[/code]rnrn[code=text]rnexport OS_TENANT_NAME=adminrnexport OS_USERNAME=adminrnexport OS_PASSWORD=admin_passrnexport OS_AUTH_URL="<em>http</em>://192.168.<em>1.1</em>55:35357/v2.0/" rn[/code]rnrnnetwork:rn#externalrneth0 Link encap:Ethernet HWaddr 00:0c:29:a7:0d:17 rn inet addr:192.168.56.122 Bcast:192.168.56.255 Mask:255.255.255.0rn inet6 addr: fe80::20c:29ff:fea7:d17/64 Scope:Linkrn UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1rn RX packets:3353 errors:0 dropped:0 overruns:0 frame:0rn TX packets:3038 errors:0 dropped:0 overruns:0 carrier:0rn collisions:0 txqueuelen:1000 rn RX bytes:2509912 (2.5 MB) TX bytes:369099 (369.0 KB)rn#internalrneth1 Link encap:Ethernet HWaddr 00:0c:29:a7:0d:21 rn inet addr:192.168.<em>1.1</em>55 Bcast:192.168.1.255 Mask:255.255.255.0rn inet6 addr: fe80::20c:29ff:fea7:d21/64 Scope:Linkrn UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1rn RX packets:5960 errors:0 dropped:0 overruns:0 frame:0rn TX packets:53 errors:0 dropped:0 overruns:0 carrier:0rn collisions:0 txqueuelen:1000 rn RX bytes:571281 (571.2 KB) TX bytes:7439 (7.4 KB)rnrnrnendpoint create:rnHOST_IP:192.168.<em>1.1</em>55rnEXT_HOST_IP:192.168.56.122rnrn compute)rn keystone endpoint-create --region $KEYSTONE_REGION --service-id $2 --publicurl '<em>http</em>://'"$EXT_HOST_IP"':8774/v2/$(tenant_id)s' --adminurl '<em>http</em>://'"$HOST_IP"':8774/v2/$(tenant_id)s' --internalurl '<em>http</em>://'"$HOST_IP"':8774/v2/$(tenant_id)s'rnrn环境变量:rnexport OS_TENANT_NAME=adminrnexport OS_USERNAME=adminrnexport OS_PASSWORD=admin_passrnexport OS_AUTH_URL="<em>http</em>://192.168.<em>1.1</em>55:35357/v2.0/"rnrnrnrnrnrn rnrn
401 Unauthorized
我建设了web服务器后,我进入自己的网站,结果出现输入用户名与密码,无论输入什么都无法登陆网站,三次后出现rnrn <em>401</em> Unauthorizedrn Unauthorizedrnrnrn怎么样解决? rn
请求因 HTTP 状态 401 失败: Unauthorized
如题,调用web Service的<em>时候</em>报错。把IIS里的允许匿名访问打钩也不行。哪位帮忙解决一下?
The request failed with HTTP status 401:Unauthorized
我在Server系统IIS上布了一个WebService,单独在IIS里浏览使用这个WebService没问题的,用aspx网页或者C#的WinForm程序调就出现错误rnThe request failed with HTTP status <em>401</em>:Unauthorized rn这个问题是不是跟系统有关,有什么权限需要打开吗?rn我在XP系统的机器上这样的操作都可以的
求助:C# HTTP身份验证返回401 unauthorized
我用c#写的windows 程序实现<em>http</em>请求获取服务器端页面,其中服务器端需身份验证,用的是NetworkCredentials的一个实例来完成身份验证,但是调试时仍返回<em>401</em><em>unauthorized</em>,位置在using (HttpWebResponse response = request.GetResponse() as HttpWebResponse),请大侠指点,多谢!rnrn代码如下:rnrn// Create the web request rnHttpWebRequest request rn = WebRequest.Create("<em>http</em>://xxx") as HttpWebRequest; rn rn// Add authentication to request rnrequest.Credentials = new NetworkCredential("username", "password"); rn rn// Get response rnusing (HttpWebResponse response = request.GetResponse() as HttpWebResponse) rn rn // Get the response stream rn StreamReader reader = new StreamReader(response.GetResponseStream()); rn rn // Console application output rn Console.WriteLine(reader.ReadToEnd()); rn rnrn
java ik分词 HttpResponseProxy{HTTP/1.1 401 Unauthorized
之前一直好好的,自从公司搬个家之后就不行了,通过url访问ik分词的<em>时候</em>会直接报<em>401</em> // 从客户端<em>发送</em>HTTP请求到服务器端, CloseableHttpClient <em>http</em>Client = HttpClients.createDefault(); String analyzer = ""; int analyzerType = 0; if (analyzerType
post"">curl -X post http://localhost:8888/bus/refresh throws HttpRequestMethodNotSupportedException "post"
在用Spring Cloud Bus、kafka实现config-server自动刷新配置的<em>时候</em>,执行命令:curl -X <em>post</em> <em>http</em>://localhost:8881/bus/refresh报如下错误:{"timestamp":1513070184793,"status":405,"error":"Method Not Allowed","exception":"org.springfra
请求因 HTTP 状态 401 失败:Unauthorized
windows 或 web 程序调用 webservice 出现如下的错误,我的webservice没问题,<em>http</em>://localhost/collaboration.webservice/services.asmx可以正常运行,可是调用的<em>时候</em>出现错误,我是从别的机器上拷贝过来的源程序,编译一切正常,在北的机器上也是正常,我的这台机器原来(5.1以前)也是正常,别的机器上的就是从我的这台机器上拷贝过去了,又拷了回来,怎么会出现这样的错误呢?请高手帮帮忙,有谁遇到过类似的情况?rnrn错误信息:rnrn请求因 HTTP 状态 <em>401</em> 失败:Unauthorized。 rn说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 rnrn异常详细信息: System.Net.WebException: 请求因 HTTP 状态 <em>401</em> 失败:Unauthorized。rnrn源错误: rnrnrn行 775: [System.Web.Services.Protocols.SoapDocumentMethodAttribute("<em>http</em>://tempuri.org/DeptsLists", RequestNamespace="<em>http</em>://tempuri.org/", ResponseNamespace="<em>http</em>://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]rn行 776: public System.Data.DataSet DeptsLists() rn行 777: object[] results = this.Invoke("DeptsLists", new object[0]);rn行 778: return ((System.Data.DataSet)(results[0]));rn行 779: rn rnrn源文件: \\192.168.0.88\My Tests$\Collaboration.Web\Web 引用\Collaboration-WebService\Reference.cs 行: 777 rnrn
请求因 HTTP 状态 401 失败:Unauthorized。
我的程序调用web services,出错,请问怎么回事?rnPrivate Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Clickrn Dim m_ws1 As New ws1.ws1rn Response.Write(m_ws1.HelloWorld)rn End Subrn
idhttp 发送post失败。。。
我想<em>发送</em>一段这样的数据给192.168.0.1:9999端口rnPOST /test.asp?id=123456&ps=654321&str=我来做测试HTTP/1.0.. Connection: keep-alive..Content-Type: application/x-www-form-urlencoded..Content-Length: 4284..Host: 192.168.0.1:9999..Accept: text/html, */*..Accept-Encoding: identity..User-Agent: Mozilla/3.0 (compatible; Indy Library)rnrn[code=Delphi(Pascal)]rnServerUrl:= '192.168.0.1';rnGrStr:='我来做测试';rnParams := TStringList.Create;rnParams.Add('/test.asp?id=123456&ps=654321&str='+GrStr ) ;rnParams.Add('/test.asp?id==123456');rnParams.Add('&h=123456');rnParams.Add('&str='+GrStr);rn<em>id<em>http</em></em>1.Port :=9999;rn<em>id<em>http</em></em>1.Request.Connection :='keep-alive';rn<em>id<em>http</em></em>1.Request.ContentType :='application/x-www-form-urlencoded';rn<em>id<em>http</em></em>1.Request.Host :='192.168.0.1';rn<em>id<em>http</em></em>1.Request.Accept :='text/html, */*';rn<em>id<em>http</em></em>1.Request.AcceptEncoding :='identity';rn<em>id<em>http</em></em>1.Request.UserAgent :='Mozilla/3.0 (compatible; Indy Library)';rnTestStr:=<em>id<em>http</em></em>1.Post(ServerUrl , Params ); //到了这里就Socket Error 10061错误了。。。rn[/code]
failed to open stream: HTTP request failed! HTTP/1.0 401 Unauthorized
a.php 包含下面代码:1或2代码rn1、fopen("cmd.php",'r');rn2、fopen(" <em>http</em>://192.168.<em>1.1</em>7:80/cmd.php","r");rnrn我在浏览器能这过 <em>http</em>://192.168.<em>1.1</em>7/a.php rnrn当代码中为1时没有报错,但是就成2了之后就报如下错rnrnWarning: fopen( <em>http</em>://192.168.<em>1.1</em>7:80/cmd.php): failed to open stream: HTTP request failed! HTTP/1.0 <em>401</em> Unauthorized in /usr/local/www/a.php on line 5 rnrnrnfopen(" <em>http</em>://www.07fly.com/index.php","r");这样就没有问题~~rnfopen(" <em>http</em>://192.168.<em>1.1</em>7:80/cmd.php","r");这样就不行~~rnrn浏览器直接访问:<em>http</em>://192.168.<em>1.1</em>7:80/cmd.php 这样访问没有问题、rn
如何发送HTTP 401错误,
我想让页面弹出一个身份验证的对话框,类似于带路由的ADSL猫进去时的。rn某大侠<em>提示</em>可以<em>发送</em>HTTP <em>401</em>实现,但他给出的方法是response.write();但我这个服务器不支持rnresponse对象,只支持部分asp,支持javascript,能不能自己在html头部中发<em>http</em> <em>401</em>?
idhttp post提交网页时报'HTTP/1.1 405 Method Not Allowed'
抓包数据:rnPOST /login.aspx HTTP/<em>1.1</em>rnAccept: image/jpeg, application/x-ms-application, image/gif, application/xaml+xml, image/pjpeg, application/x-ms-xbap, application/x-shockwave-flash, application/vnd.ms-excel, application/msword, */*rnReferer: <em>http</em>://www.cnlinfo.net/login.aspxrnAccept-Language: zh-CNrnUser-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; EmbeddedWB 14.52 from: <em>http</em>://www.bsalsa.com/ EmbeddedWB 14.52; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; Tablet PC 2.0)rnContent-Type: application/x-www-form-urlencodedrnAccept-Encoding: gzip, deflaternHost: www.cnlinfo.netrnContent-Length: 229rnConnection: Keep-AlivernCache-Control: no-cachernCookie: Hm_lvt_8803f7fa56465a59d0c1a12ec666f533=1368799256,1368803521,1369021257,1369038720; Hm_lpvt_8803f7fa56465a59d0c1a12ec666f533=1369038720; bdshare_firstime=1367801140475; ASP.NET_SessionId=4nckfv55dmys20452gi2jvrmrn__VIEWSTATE=%2FwEPDwUJODI5MjcyNzM1D2QWAgIDD2QWAgIFDw8WAh4EVGV4dAUFOCsxMz1kZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQUHSW1nX0J0bv77TZpONe7QCO7Gu0iZqLY%2BmnKw&tbx_Name=test&tbx_pwd=test&Txt_code=21&Img_Btn.x=86&Img_Btn.y=10rn代码:rn[code=delphi]procedure TForm1.SB_DLClick(Sender: TObject);rnvarrn url:string;rn Param:TStringList;rn RStream:TStringStream;rnbeginrn url:='<em>http</em>://www.cnlinfo.net/login.aspx';rn id<em>post</em>.Request.Referer:='<em>http</em>://www.cnlinfo.net/login.aspx';rn id<em>post</em>.Request.Host:='www.cnlinfo.net';rn ID<em>post</em>.Request.SetHeaders;rn ID<em>post</em>.Request.RawHeaders.Clear;rn ID<em>post</em>.HandleRedirects := true;rn ID<em>post</em>.HTTPOptions := ID<em>post</em>.HTTPOptions + [hoKeepOrigProtocol];rn ID<em>post</em>.ProtocolVersion := pv1_1;rn ID<em>post</em>.Request.Accept := '*/*';rn ID<em>post</em>.Request.AcceptLanguage := 'zh-cn';rn ID<em>post</em>.Request.UserAgent := 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; EmbeddedWB 14.52 from: <em>http</em>://www.bsalsa.com/ EmbeddedWB 14.52; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; Tablet PC 2.0)';rn ID<em>post</em>.Request.Connection := 'Keep-Alive';rn ID<em>post</em>.Request.CacheControl := 'no-cache';rn ID<em>post</em>.Request.ContentType := 'application/x-www-form-urlencoded';rn //id<em>post</em>.Request.ContentType:='multipart/form-data';rn param:=TStringList.Create;rn Rstream:=TStringStream.Create('');rn param.Add('__VIEWSTATE='+chstrid+'');//验证字符串存于页面name="__VIEWSTATE",启动时GET网页提取并赋值给CHSTRIDrn param.Add('tbx_Name=go2013');rn param.Add('tbx_pwd=go2013');rn param.Add('Txt_code='+Edit3.Text+'');//验证码rn param.Add('Img_Btn.x=64');rn param.Add('Img_Btn.y=23');rn id<em>post</em>.<em>post</em>(url,param,Rstream);rn memo1.Text:=utf8toansi(Rstream.DataString);rn Rstream.Free;rnend;rnrn[/code]rnrn错误信息:环境D7+WIN7
401 Unauthorized 错误是什么问题
我用REST API修改Azure的虚拟机数量,为什么总是报这个错~~ Bug吗?n
TIdHTTP 用ccproxy代表出现 HTTP/1.1 407 Unauthorized 异常.
TIdHTTP 用ccproxy代表出现 HTTP/<em>1.1</em> 407 Unauthorized 异常.rnrn求解决方法, 代理是可以正常用的.rnrn idhtp1.ProxyParams.ProxyServer := edt1.Text;rn idhtp1.ProxyParams.ProxyUsername := edt3.Text;rn idhtp1.ProxyParams.ProxyPort := StrToInt(edt2.Text);rn idhtp1.ProxyParams.ProxyPassword := edt4.Text;rn //idhtp1.ProxyParams.
delphi idhttp发送http
用软件抓取到的<em>http</em>头信息但是不知道怎么用<em>id<em>http</em></em><em>发送</em>,高手指点下rn(Request-Line):GET / HTTP/<em>1.1</em>rnx-flash-version: 10,0,45,2rn目前就这两个不知道<em>发送</em>。
▲▲▲▲创建http://localhost/webapplication1的时候提示"Unauthorized",为什么啊▲▲▲▲
用vs.net 2003创建<em>http</em>://localhost/webapplication1rn昨天还好好的,中了一个什么蠕虫病毒,就不行了rn错误<em>提示</em>是:rnrnVisual Studio 无法识别 Web 服务器上的 ASP.NET 版本。尝试创建 Web 项目或打开位于 URL“<em>http</em>://localhost/WebApplication1”的 Web 项目时,Web 服务器报告了以下错误。“HTTP/<em>1.1</em> <em>401</em> Unauthorized”。rnrnrn请指教
用header发送http/1.1 头的问题
因为公司业务需要。需要对系统语言是zh-cn的进行屏蔽,所以想到用headerrn实现的基本功能rn//header( 'WWW-Authenticate:Negotiate '); rn//header('WWW-Authenticate:NTLM ',false);rn上面两个header都现在正常显示。rn但是rnheader("HTTP/<em>1.1</em> 404 Not Found"); rn 用print_r(apache_response_headers())显示<em>发送</em>的的<em>http</em>信息为空rn但是rnheader("HTTP/<em>1.1</em> 404 Not Found"); rn header("testheader: value1"); rn header('Content-type: text/plain');rn这两个用print_r(apache_response_headers())都可以正常显示<em>发送</em>的的<em>http</em>信息?rn何问题?rnheader('HTTP/<em>1.1</em> 301 Moved Permanently ');也可以正常工作,为何?
报表服务http://localhost/reportservice/ 不能登陆,提示 The request failed with HTTP status 401: Unauthorized
如题 报表服务rn<em>http</em>://localhost/reportservice/ 不能登陆,rnrn<em>提示</em> The request failed with HTTP status <em>401</em>: Unauthorizedrnrn不知道是什么 原因? 请各位大侠帮忙.
401 Unauthorized")验证的用户名和密码?">关于Header("HTTP/1.0 401 Unauthorized")验证的用户名和密码?
在学习一个php小系统中遇到如下的<em>http</em>验证的问题:弹出一个<em>提示</em>连接到localhost的小窗口,<em>提示</em>输入用户名和密码,且错误输入3次后,会显示如下代码中“请与管理员联系,获取登录的用户名和密码!”的内容。不知道这个用户名和密码是什么? 不是admin/123 希望高手指点…… rnrnrn代码如下: rnrn请与管理员联系,获取登录的用户名和密码! ";rn include("footer.php");rn exit;rnrnelsern //设置用户登录的用户名和密码!rn if($PHP_AUTH_USER != "admin" && $PHP_AUTH_PW != "123") rn $title = "";rn include("header.php");rn echo "Incorrect Login.";rn include("footer.php");rn exit;rn rnrn?>rnrnrnrn
请教高手,错误:请求因 HTTP 状态 401 失败:Unauthorized
我把远程服务器的网站和数据库文件都拷到的本机,现在网站的首页default.aspx能打开,但是登陆用户的<em>时候</em>就会出现下面的错误:rn“/xywebinfo”应用程序中的服务器错误。rn--------------------------------------------------------------------------------rnrn请求因 HTTP 状态 <em>401</em> 失败:Unauthorized。 rn说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 rnrn异常详细信息: System.Net.WebException: 请求因 HTTP 状态 <em>401</em> 失败:Unauthorized。rnrn源错误: rnrn执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。 rnrn堆栈跟踪: rnrnrn[WebException: 请求因 HTTP 状态 <em>401</em> 失败:Unauthorized。]rn System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +1303rn System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +218rn Epoint.UURPLib.ADProxy.ADUser_Service_Proxy.UserLogin(String LoginID, String Password) in E:\工作目录\Project2005\电子政务系统\Epoint.UURPLibrary\ADProxy\ADUser_Service_Proxy.cs:166rn Epoint.UURPLib.AdOperate.ADUsers.UserLogin(String LoginID, String PassWord) in E:\工作目录\Project2005\电子政务系统\Epoint.UURPLibrary\AdOperate\ADUsers.cs:1017rn WebBuilder.index.BtnLogin_Click(Object sender, EventArgs e)rn System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108rn System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57rn System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18rn System.Web.UI.Page.RaisePostBackEvent(NameValueCollection <em>post</em>Data) +33rn System.Web.UI.Page.ProcessRequestMain() +1292rnrn rnrnrn--------------------------------------------------------------------------------rn版本信息: Microsoft .NET Framework 版本:<em>1.1</em>.4322.2379; ASP.NET 版本:<em>1.1</em>.4322.2379 rnrnrn请问大家可能是什么原因啊?
WebException: 请求因 HTTP 状态 401 失败:Unauthorized 错误!
System.Net.rnWebException: 请求因 HTTP 状态 <em>401</em> 失败:Unauthorizedrnrn===================================rn从微软的老师那里弄了一个web Service的例子,配置好后,程序调用web 方法的<em>时候</em>出现错误,我用浏览器访问的<em>时候</em>没有问题,可以看到web 方法,我查看web.configrn 和rn 都试过了,还是不行,刚开始研究web service 请指教!
发送HTTP请求POST
//url:目标地址和端口,<em>post</em>String:字符串内容 public static  String doPostWithoutKey(String url,String <em>post</em>String) throws IOException {     HttpClient client = new HttpClient();     //请求 网络上的服务, 用这种方式请求本地,返回一个Html页...
http 发送post请求
<em>http</em> <em>post</em><em>发送</em>请求
Http发送Post请求
    1:直接调用<em>发送</em> Java开发交流群     677807540   public static String sendPostJson(String sendurl, String data) { CloseableHttpClient client = HttpClients.createDefault(); HttpPos...
Web后端http请求(带用户名和密码防止401 Unauthorized)
Java Java这方面的Jar包应该比较多,比如HttpClient,我这里使用最基本的: [java] view plain copy   //认证信息对象,用于包含访问翻译服务的用户名和密码                 Authenticator auth = new MyAuthenticator("用户名", "密码");
请教简单的问题:请求因 HTTP 状态 401 失败:Unauthorized。
小弟新学webservics就出现问题。配置是win2003和.net<em>1.1</em>rnrnrn“/myweb1”应用程序中的服务器错误。rn--------------------------------------------------------------------------------rnrn请求因 HTTP 状态 <em>401</em> 失败:Unauthorized。 rn说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 rnrn异常详细信息: System.Net.WebException: 请求因 HTTP 状态 <em>401</em> 失败:Unauthorized。rnrn源错误: rnrnrn行 35: [System.Web.Services.Protocols.SoapDocumentMethodAttribute("<em>http</em>://tempuri.org/HelloWorld", RequestNamespace="<em>http</em>://tempuri.org/", ResponseNamespace="<em>http</em>://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]rn行 36: public string HelloWorld() rn行 37: object[] results = this.Invoke("HelloWorld", new object[0]);rn行 38: return ((string)(results[0]));rn行 39: rn rnrn源文件: D:\work\myweb1\Web References\myservics\Reference.cs 行: 37 rnrn堆栈跟踪: rnrnrn[WebException: 请求因 HTTP 状态 <em>401</em> 失败:Unauthorized。]rn System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +1296rn System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +218rn myweb1.myservics.Service1.HelloWorld() in D:\work\myweb1\Web References\myservics\Reference.cs:37rn myweb1.WebForm1.Page_Load(Object sender, EventArgs e) in d:\work\myweb1\webform1.aspx.cs:25rn System.Web.UI.Control.OnLoad(EventArgs e) +67rn System.Web.UI.Control.LoadRecursive() +35rn System.Web.UI.Page.ProcessRequestMain() +731rnrn rnrnrn--------------------------------------------------------------------------------rn版本信息: Microsoft .NET Framework 版本:<em>1.1</em>.4322.573; ASP.NET 版本:<em>1.1</em>.4322.573
401 Unauthorized");">这句话是什么意思: header("HTTP/1.0 401 Unauthorized");
这句话是什么意思: header("HTTP/1.0 <em>401</em> Unauthorized");
怎么登录用http头的401 Unauthorized进行身份验证的服务器?
用fsockopen请求一个url,服务器那边发来<em>http</em>头<em>401</em> Unauthorized进行身份验证,怎么把帐密发过去好实现登录呢?
The request failed with HTTP status 401: Unauthorized问题怎么解决
我之前写了一个关于两个sharepoint list (功能是:list1 取 list2 中 Items ) webpart, 调试时正常运行(此处的运行时通过手动点击button 来实现list1 取 list2 中items的功能)。 现在我需要把这同步的功能通过Timer Job 来实现,即通过timer job 让系统自动运行, 但是 我在调试中有几个个问题:rn问题1: 调试中出现的为问题:“ The request failed with HTTP status <em>401</em>: Unauthorized。” 相同的代码,怎么会在之前的button下调试时可以成功,而放到Timer Job 里面却出现了权限的问题呢? rnrn对于这个问题,因为我是让list2 中的数据从list1 去过来的,而这两个list 在不同服务器上,这个的实现上我采用了调用 list webservice 实现了, 在权限问题上我想过如果用 SPSecurity.RunWithElevatedPrivileges(delegate() ) 这个方法,那要怎么去用呢 ? rnrn 一下是我在 Timer Job 中 Job类 中 Execute () 方法中片段代码:rn public override void Execute(Guid contentDbId)rn [color=#FFCC00][/color]rn [color=#FF6600] SPSecurity.RunWithElevatedPrivileges(delegate()rn [/color]rn SPWebApplication webApplication = this.Parent as SPWebApplication;rnrn //SPContentDatabase contentDb = webApplication.ContentDatabases[contentDbId];rn //SPList myDestinationList = contentDb.Sites[0].RootWeb.Lists["List1"];rn //SPWeb myDestinationWeb = contentDb.Sites[0].OpenWeb(); rnrnrn nsplist.Lists List1 = new nsplist.Lists();rn List1.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;rnrn List1.Url = "<em>http</em>://gdcckm.chn.test.com/teams/nsp/_vti_bin/Lists.asmx";rn System.Xml.XmlDataDocument xmlDoc = new System.Xml.XmlDataDocument();rn string listName = "0F57EBB4-B86E-4156-BA15-409DA6769422";rn string rowLimit = "10000";rnrn System.Xml.XmlNode nodeListItems;rn System.Xml.XmlElement query = xmlDoc.CreateElement("Query");rn System.Xml.XmlElement viewFields = xmlDoc.CreateElement("ViewFields");rn System.Xml.XmlElement queryOptions = xmlDoc.CreateElement("QueryOptions");rn nodeListItems = List1.GetListItems(listName, null, query, null, rowLimit, null); rn xmlDoc.LoadXml(nodeListItems.OuterXml);rn XmlNodeList nlist = xmlDoc.GetElementsByTagName("z:row");rnrn SPSite myDestinationSite = new SPSite("<em>http</em>://hswsrdm0");rn SPWeb myDestinationWeb = myDestinationSite.OpenWeb();rn SPList myDestinationList = myDestinationWeb.Lists["List2"];rn ..........rn ............rn [color=#FF6600] );[/color]rn [color=#FFCC00] [/color] 可是在这个地方就出现了 权限那个问题, rnrnrn请大侠们抽出点宝贵时间,帮忙看看。 rn
idhttppost方法怎么用
我用delphi7中<em>id<em>http</em></em>控件做一个自动登陆网页的程序。在<em>post</em>数据的<em>时候</em>总是出现一个“<em>http</em><em>1.1</em> /302 found”的错误。rn代码如下:rn procedure TForm1.Button1Click(Sender: TObject);rnrnbeginrn <em>post</em>str := tstringlist.Create;rn <em>post</em>str.add('username=XXXX');rn <em>post</em>str.add('password=XXXX');rn <em>post</em>str.add('utoLogin=true');rn <em>post</em>str.add('ourl=<em>http</em>%3A%2F%2Fwww.56.com%2F%3F8<em>401</em>');rn <em>id<em>http</em></em>1.HandleRedirects := true;rn str := <em>id<em>http</em></em>1.<em>post</em>('<em>http</em>://XXXXX.com/php/urs.php', <em>post</em>str);rn memo1.Text := system.UTF8Decode(str);rn <em>post</em>str.Free;rnend;rn如果把<em>id<em>http</em></em>1.HandleRedirects := false;就出现“<em>http</em>/<em>1.1</em> 404”错误。rn同样抓包回来的数据用VB写的程序<em>post</em>的<em>时候</em>就没有问题,所以数据应该是没有问题的。
idhttp post
)W...........wappass.baidu.com......$rn)W...........wappass.baidu.com.............. .....0......... ....%Y........^6...ns4..........^6...dns..........^6...ns3..........^6...ns2..........3n..=....s......3n....%..O......(.....&..a......3n...l..rnrnrn<em>发送</em>rnPOST /wpass HTTP/<em>1.1</em>..rnContent-Type: application/x-www-form-urlencoded..rnContent-Length: 86..rnHost: wappass.baidu.com..rnAccept: text/html, */*..rnUser-Agent: NokiaN90-1/3.0545.5.1 Series60/2.8 Profile/MIDP-2.0 Configuration/CLDC-<em>1.1</em>.......rn<em>发送</em>rnct=login&tpl=wapp&u=&retry=/wpass&username=ZZZZZ&password=ZZZZZ&save=0&from=&ssid=0rn接收rnHTTP/<em>1.1</em> 200 OK..rnDate: Tue, 26 Aug 2008 10:58:41 GMT..rnCache-Control: max-age=0..rnSet-Cookie: BDUSS=k2WsdfasgdgasdgadgVXpPcFsdfsfsdfsdfsQUFBJCQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOdfsdfsdfIZE; path=/; domain=.baidu.com..rnSet-Cookie: WAPTIME=1219748322; expires=Sun, 23 Aug 2020 08:23:00 GMT; path=/; domain=.baidu.com..rnContent-Type: text/vnd.wap.wml;charset=UTF-8..rnContent-Length: 759..rnConnection: close....rnrnrn..... ............. ...................... . ................... ................... . ...rn
idHttp的Post方法怎么用
idHttp的Post方法到底怎么用牙,那位高手能指教一下。rn我把数据Post传上去不行么rn我传了个txtUN=Admin&txtPW=123445&Submit=%CC%E1%BD%BB
idhttp post数据的问题
用<em>id<em>http</em></em>.<em>post</em>登陆数据,得到返回结果,怎么得到的还是未登陆的信息?rnrn代码:rnvar param :TstringList;rn Response: TStringStream;rnbeginrnResponse := TStringStream.Create('');rnparam:=TstringList.create;rnparam.add('membername=user');rnparam.add('memberpass=password');rnrn<em>id<em>http</em></em>1.<em>post</em>('<em>http</em>://www.2ccc.com',param,Response);rnmemo1.text:=Response;rnrn...rnend;rnrn返回的信息还是未登陆的,请高手指教。
Idhttp Post
E.....@.......e.v.o...PPH.p.r=.P...@_..POST /lbr_sports HTTP/<em>1.1</em>..Accept: */*..Referer: <em>http</em>://www.lad168.com/lbr_sports?action=INT_SPORTSBOOK::go_sports_menu..Accept-Language: zh-cn..Content-Type: application/x-www-form-urlencoded..Accept-Encoding: gzip, deflate..User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Alexa Toolbar)..Host: www.lad168.com..Content-Length: 405..Connection: Keep-Alive..Cache-Control: no-cache..Cookie: LANG=cs; flash_version=6; CP=null*; CASAFF_ID=default; RC_AFF=0; EXT_AFF=; CTXT=PORTAL; BETSLIP=refresh|0|selns|0; FLAGS=cs|cs|cs|fareast|DECIMAL|0|GBP....action=INT_SPORTSBOOK%3A%3Ado_sports_menu&this_action=INT_SPORTSBOOK%3A%3Ago_sports_menu&checked_subtypes=370&checked_evtypes=&checked_ordered=S+370+&expanded_classes=110000045&expanded_evtypes=&sel_disp_sort_id=&sel_disp_sort_tmpl=&mkt_ev_oc_grp_id=&mkt_disp_sort_id=&mkt_template=&mkt_chkd_ordered=&timefilter=&category=&class_id=&class_sort=&type=&id=&ev_id=&ev_mkt_id=&int_event=&gr_trap=&auto_submit=rn如何把上面的数据 Post给页面(上面的信息是用网络数据监视器截取的)
vc 用socket 发送http post 请求
挺适合新手看的,这是我刚接触c++时写的,新手也很容易看懂
用win32api发送http POST的问题
我观察网页实现文件上传表单 上传一个文件时 都是用的mulptipart/form-data这样的格式,这个通过抓包可以看到。观察了360的云盘 似乎同步文件也是用的这种格式。rnrn用<em>http</em>sendrequest可以实现<em>post</em>包 后面加数据 但是并非mulptipart/form-data这样的格式 而且一次只能发一个文件rnrn现在有个问题,我不是在做网页程序,而是普通的客户端程序 我想用wininet或者win<em>http</em>实现<em>发送</em>这样的<em>post</em>包 即一个包含了多个文件的mulptipart/form-data格式的包 该如何实现? 或者用到哪些api可以实现rn
401 Unauthorized") 出现的问题">使用 Response.Status = ("401 Unauthorized") 出现的问题
为了验证用户身份,我在页面起始处使用了这样的语句,结果弹出的对话框要求rn输入用户名和密码的<em>时候</em>,我只能输入属于administrators组的用户名和密码才rn能通过该认证对话框,而输入普通用户名这不行,我把普通用户名升级到administratorsrn组成员则可以。rn代码如下。rn.....rn If InStr(1, "_BasicNTLM", strAT, vbTextCompare) < 2 Thenrn Response.Status = ("<em>401</em> Unauthorized")rn Response.Endrn Elsern BAuthenticateUser = Truern...rnrnrn请教该如何设置才能让普通用户能通过这样的认证
SIP 401 Unauthorized 错误如何解决阿?
需要注册到服务器,可是需要authorized,rn都需要什么条件,怎么解决阿?rn急!rn先谢过了。
Idhttp发HTTP POST请求问题
rn在局域网用浏览器发HTTP POST 请求访问WEB服务器,速度很快,大致是几毫秒级的rn而在局域网用Id<em>http</em>发HTTP POST 请求访问WEB服务器,速度慢很多,200毫秒左右rnrn客户端Id<em>http</em>方式访问本机发布的WEB服务器,速度也同几毫秒,很快。rn客户端Id<em>http</em>方式访问局域网发布的WEB服务器,速度就降到200毫秒了rnrn请教各位大牛,rn怎样用DELPHI发HTTP POST请求,在局域网范围让速度控制在几十毫秒以下rnrn急急急,救命啊
401 Unauthorized") 出现的问题。">使用 Response.Status = ("401 Unauthorized") 出现的问题。
为了验证用户身份,我在页面起始处使用了这样的语句,结果弹出的对话框要求rn输入用户名和密码的<em>时候</em>,我只能输入属于administrators组的用户名和密码才rn能通过该认证对话框,而输入普通用户名这不行,我把普通用户名升级到administratorsrn组成员则可以。rn代码如下。rn.....rn If InStr(1, "_BasicNTLM", strAT, vbTextCompare) < 2 Thenrn Response.Status = ("<em>401</em> Unauthorized")rn Response.Endrn Elsern BAuthenticateUser = Truern...rnrnrn请教该如何设置才能让普通用户能通过这样的认证
使用Yahoo api报错401 Unauthorized
各位大侠,遇到一个问题,一直解决不了,找不到原因,rn使用yahoo api过程中报错,<em>401</em> Unauthorizedrn授权都成功,<em>http</em>s://api.login.yahoo.com/oauth/v2/get_request_token,<em>http</em>s://api.login.yahoo.com/oauth/v2/request_auth,<em>http</em>s://api.login.yahoo.com/oauth/v2/get_token,这几个API都成功,拿到了最终的oauth_token,oauth_token_secret,guid等数据。但是问题来了,当我用 social profile的api<em>时候</em>,就报错了,[code=csharp]string url = string.Format("<em>http</em>://social.yahooapis.com/v1/user/0/profile?format=json", YahooToken.xoauthYahooGuid); [/code],参考地址:<em>http</em>://developer.yahoo.com/oauth/guide/oauth-make-request.html,构造请求的那些数据,如nonce,timestamp,signature用的BaseOAuth类(<em>http</em>://oauth.googlecode.com/svn/code/csharp/OAuthBase.cs),授权过程中用的是PLAINTEXT方式,使用<em>http</em>://social.yahooapis.com/v1/user/0/profile?format=json api的<em>时候</em>用的是HMACSHA1方式。rn有一个实例参考(<em>http</em>://blog.sina.com.cn/s/blog_7648f7170100qcdz.html),我也按照那上面的写的,授权登入成功,最后用user profile api也还是不行,一直报<em>401</em>.。。。崩溃了。。。。。。。rn求各位大侠帮忙!!!!!!!!!!!!!!!!!!!rn这到底啥原因!!!!!!!!!rn顺便再吐槽一下。用过oauth2.0,觉得oauth 1.0 真心蛋疼。rn求助!!!!!!!!!!!!!!!!!!!!!!!!!!!rn[code=csharp]string nUrl, nParams;rn string nonce = this.GenerateNonce();rn string timestamp = this.GenerateTimeStamp();rn string UrlData = string.Format("<em>http</em>://social.yahooapis.com/v1/user/" + YahooToken.xoauthYahooGuid + "/profile?format=json");rn string signature = this.GenerateSignature(new Uri(UrlData), clientID, clientSecret, YahooToken.oauthToken, YahooToken.oauthTokenSecret, "GET", timestamp, nonce, out nUrl, out nParams);rn HttpWebRequest request = (HttpWebRequest)WebRequest.Create(new Uri(UrlData));rn request.Method = "GET";rn StringBuilder sb = new StringBuilder();rn sb.Append("Authorization: OAuth ");rn sb.Append("realm=\"yahooapis.com\"");rn sb.Append(",oauth_consumer_key=\"" + clientID + "\"");rn sb.Append(",oauth_nonce=\"" + nonce + "\"");rn sb.Append(",oauth_signature_method=\"HMAC-SHA1\"");rn sb.Append(",oauth_timestamp=\"" + timestamp + "\"");rn sb.Append(",oauth_token=\"" + YahooToken.oauthToken + "\"");rn sb.Append(",oauth_version=\"1.0\"");rn sb.Append(",oauth_signature=\"" + this.UrlEncode(signature) + "\"");rn request.Headers.Add(sb.ToString());rn HttpWebResponse response = (HttpWebResponse)request.GetResponse();[/code]
pb9.0 调用webservice 报错 401 Unauthorized
pb9.0 调用webservice 报错 <em>401</em> Unauthorizedrn地址:rn<em>http</em>s://grouptest.pension.taikang.com:8440/jx/services/JXMedInterface?wsdlrn安装了证书rnrnrn代码:rnsoapconnection connrnlong ll_retrnrntkjxmedinterface proxyrnrnrnconn = create soapconnectionrnconn.SetOptions("SoapLog=~"C:\mySoapLog.log~"") rnll_ret = conn.CreateInstance(proxy,"tkjxmedinterface",'<em>http</em>s://grouptest.pension.taikang.com:8440/jx/services/JXMedInterface?wsdl')rnif (ll_ret <> 0) thenrn messagebox('出错','不能创建代理:mymssqlsoap')rn return -1rnend ifrn rntry rn as_tns9__checkreplyint = proxy.CheckRemaining(as_certifycode,as_tns1__certifyint)rn return 1rncatch (SoapException e)rn messagebox('Error',e.getmessage())rn return -1rnend tryrnrnDestroy conn
请问:401 Unauthorized Access 是什么错误?
我的网站在一局域网内,用花生壳动态绑定IP.rn昨天还好好的访问,什么都没有动,也就是说没有人动路由器,可今天早上一起来就出现了上面的错误:rn网址:<em>http</em>://www.yueyan.com 先谢谢了.
The remote server returned an error: (401) Unauthorized
[code=C#]rntryrn rn PdfReader reader = new PdfReader(filePath);(这里出现error)rn AcroFields acro = reader.AcroFields;rn List signList = acro.GetSignatureNames();rnrn reader.Close();rn rn catch (Exception ex)rn rn HttpContext.Current.Response.Write("Error :" + ex.Message + ex.StackTrace);rn rn[/code]rnrn奇怪的是:部署到服务器上后,有些机器访问正常,而有些机器访问就会一直出错,求大牛给一些解决方案,谢谢!!
delphi 调用webservice 出现Unauthorized (401)错误
delphi 调用webservice 之前是没有密码验证的,可以正常调用webservice并正常使用服务,但后来将webservice 改成需要用户名各密码验证之后,就出现Unauthorized (<em>401</em>),不知从何要加入用户名和密码的验证rnrnrn[code=Delphi(Pascal)]// ************************************************************************ //rn// The types declared in this file were generated from data read from thern// WSDL File described below:rn// WSDL : <em>http</em>s://extranetapps.hongkongairport.com/SPMV_RPT/upload/wsdl/com/hkairport/spmv/webService/UpstreamService.wsdlrn// Encoding : UTF-8rn// Codegen : [wfDebug,wfUseSerializerClassForAttrs]rn// Version : 1.0rn// (2008-1-31 11:01:19 - 1.33.2.5)rn// ************************************************************************ //rnrnunit UpstreamService1;rnrninterfacernrnuses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;rnrntypernrn // ************************************************************************ //rn // The following types, referred to in the WSDL document are not being representedrn // in this file. They are either aliases[@] of other types represented or were referredrn // to but never[!] declared in the document. The types from the latter categoryrn // typically map to predefined/known XML or Borland types; however, they could also rn // indicate incorrect WSDL documents that failed to declare or import a schema type.rn // ************************************************************************ //rn // !:string - "<em>http</em>://www.w3.org/2001/XMLSchema"rnrnrnrn // ************************************************************************ //rn // Namespace : <em>http</em>://webService.spmv.hkairport.comrn // transport : <em>http</em>://schemas.xmlsoap.org/soap/<em>http</em>rn // style : documentrn // binding : UpstreamServiceSoapBindingrn // service : UpstreamServiceServicern // port : UpstreamServicern // URL : <em>http</em>s://extranetapps.hongkongairport.com/SPMV_RPT/upload/services/UpstreamServicern // ************************************************************************ //rn UpstreamService = interface(IInvokable)rn ['7C4BBD3A-9F99-85E7-891A-E7E5CAE0C5D6']rn function handleUpstream(const fromemail: WideString; const stringContent: WideString): WideString; stdcall;rn end;rnrnfunction GetUpstreamService(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): UpstreamService;rnrnrnimplementationrnrnfunction GetUpstreamService(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): UpstreamService;rnconstrn defWSDL = '<em>http</em>s://extranetapps.hongkongairport.com/SPMV_RPT/upload/wsdl/com/hkairport/spmv/webService/UpstreamService.wsdl';rn defURL = '<em>http</em>s://extranetapps.hongkongairport.com/SPMV_RPT/upload/services/UpstreamService';rn defSvc = 'UpstreamServiceService';rn defPrt = 'UpstreamService';rnvarrn RIO: THTTPRIO;rnbeginrn Result := nil;rn if (Addr = '') thenrn beginrn if UseWSDL thenrn Addr := defWSDLrn elsern Addr := defURL;rn end;rn if HTTPRIO = nil thenrn beginrn RIO := THTTPRIO.Create(nil);rn endrn elsern RIO := HTTPRIO;rn tryrnrn Result := (RIO as UpstreamService);rn if UseWSDL thenrn beginrn RIO.WSDLLocation := Addr;rn RIO.Service := defSvc;rn RIO.Port := defPrt;rn end elsern RIO.URL := Addr;rn finallyrn if (Result = nil) and (HTTPRIO = nil) thenrn RIO.Free;rn end;rnend;rnrnrninitializationrn InvRegistry.RegisterInterface(TypeInfo(UpstreamService), '<em>http</em>://webService.spmv.hkairport.com', 'UTF-8');rn InvRegistry.RegisterDefaultSOAPAction(TypeInfo(UpstreamService), '');rn InvRegistry.RegisterInvokeOptions(TypeInfo(UpstreamService), ioDocument);rnend.[/code]
HTTP 错误 401.3 - Unauthorized
想在自己电脑上用iis搭建服务器rn浏览<em>http</em>://localhost:8089/rn出现HTTP 错误 <em>401</em>.3 - Unauthorizedrn由于 Web 服务器上此资源的访问控制列表(ACL)配置或加密设置,您无权查看此目录或页面。rn详细信息:rn模块 IIS Web Corern通知 AuthenticateRequestrn处理程序 StaticFilern错误代码 0x80070005rn请求的 URL <em>http</em>://localhost:8089/testrn物理路径 C:\Users\dell\Desktop\testrn登录方法 匿名rn登录用户 匿名rn可能原因rn通过 Web 服务器的身份验证的用户无权打开文件系统上的文件。rn如果资源位于通用命名约定(UNC)共享内,则通过身份验证的用户可能没有足够的共享或 NTFS 权限,或者共享权限与物理路径权限不匹配。rn文件被加密。
有关报表服务器运行正确,但嵌入到网页中提示因 HTTP 状态 401 失败: Unauthorized。
解决方案: 1,调整网站所引用IIS,应用程序池,标识为自定义账户(域\计算机用户名,密码) 2,重启IIS
HTTP发送POST请求的工具类
HTTP<em>发送</em>POST请求的工具类
java代码发送HTTP Post请求
下面是实现类rn[code=Java]rnpackage com.common.action;rnrnimport java.io.BufferedReader;rnimport java.io.InputStreamReader;rnimport java.io.OutputStream;rnimport java.net.HttpURLConnection;rnimport java.net.URL;rnimport java.net.URLDecoder;rnimport org.apache.log4j.Logger;rnrnpublic class Test rn rn Logger log = Logger.getLogger(RecvReportActionTest.class);rn rn private URL url;rnrn public RecvReportActionTest(String url) throws Exception rn this.url = new URL(url);rn rnrn public String sendPostRequest(String content) throws Exception rn rn log.info("try to open <em>http</em> connection to: '" + this.url.getPath()rn + ":" + this.url.getPort() + "'");rn HttpURLConnection conn = (HttpURLConnection) this.url.openConnection();rn rn conn.setConnectTimeout(1000);rn conn.setReadTimeout(10000000);rn conn.setDoOutput(true);rn conn.setRequestMethod("POST");rn rn log.info("try to get output stream");rn OutputStream output = conn.getOutputStream();rn rn log.info("try to write '" + content + "'");rn output.write(content.getBytes());rn output.flush();rn output.close();rn rn log.info("try to get input stream");rn BufferedReader reader = new BufferedReader(new InputStreamReader(connrn .getInputStream()));rn String line;rn StringBuffer buffer = new StringBuffer("");rn rn while ((line = reader.readLine()) != null) rn buffer.append(line);rn rn rn String result = buffer.toString();rn log.info("get resposne: '" + result + "'");rn rn result = URLDecoder.decode(result, "UTF-8");rn return result;rn rn rn public static void main(String[] args)rn String url="<em>http</em>://127.0.0.1:8080/TestServlet";rn rn String content="Obj1qq20test";rn rn try rn Test test=new Test(url);rn rn String result=test.sendPostRequest(content);rn rn System.out.println(result);rn rn catch (Exception e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn rn rnrnrnrnrn[/code]rnrn在servlet端rn[code=Java]rnInputStream ins=null;rnins=request.getInputStream();rnif(ins==null|| ins.available());rn return null;rnrn[/code]rn发现servlet端ins.available()=0rn没有接收到数据。rn大家帮忙看看,哪里出问题了?rn
http POST 发送工具下载
Generate your HTTP request in seconds Using Send HTTP Tool you will be able to create and send HTTP request in just few seconds. Select your HTTP method, enter your URL. Modify HTTP header, choose the cache policy and other HTTP options and send your request. Now, when the HTTP response returned from the web, you can view detailed report.
请问如何解决:在openwave中浏览wml页,提示http error 401 unauthorized?(在线等待)
我在iis中已经添加了5中mime类型文件了,可是在openwave中输入<em>http</em>://localhost/index.wml时却<em>提示</em>我出错 <em>http</em> error <em>401</em> <em>unauthorized</em>rn请问这到底是怎么回事?rnrn谢谢
【HELP】开了匿名访问,依然提示请求因 HTTP 状态 401 失败:Unauthorized
什么原因?rn高手帮忙
登陆的时候提示401错误 怎么解决??
我把机器的密码改了,iis里的密码也改了,但是登陆的<em>时候</em>,<em>提示</em>叫输入用户名和密码,<em>提示</em>401错误,如何解决!谢谢
http post 发送xml数据
NULL 博文链接:<em>http</em>s://waynett.iteye.com/blog/1129581
python发送http post请求数据
#!/usr/bin/python3 # -*- coding:UTF-8-*- # Author: zhuhongqiang import json import time from urllib import request import urllib.request def <em>http</em>Post(): <em>post</em>_data = {} <em>post</em>_data['msg_content'...
Java发送HTTP的POST请求
Exception; import org.apache.commons.<em>http</em>client.HttpStatus; import org.apache.commons.<em>http</em>client.NameValuePair; import org.apache.commons.<em>http</em>client.methods.GetMethod; import org.apache.commons.<em>http</em>client.methods.PostMethod; import org.apache.commons.
HTTP发送POST请求说明
短信下发工具类接口代码逻辑与技术要点概括: 开发工具:MyEclipse9.0+Tomcat6.0x 测试方式:main方法体现,直接调用当前类内部接口方法(参数都走配置化) 工具类主方法:sendMsgUpdown()方法体体现内容: 参数配置化: eq-- params.properties: #msg send req public sc url autoMsg
http发送get、post请求
import com.google.common.base.Stopwatch; import com.google.common.base.Strings; import org.apache.commons.<em>http</em>client.*; import org.apache.commons.<em>http</em>client.methods.GetMethod; import org.apache.commons
java发送httppost请求
java<em>发送</em><em>http</em>的get、<em>post</em>请求Http请求类 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.URL; import java.net.URLConnectio
go Http Post 发送文件流
欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦: Markdown和扩展Markdown简洁的语法 代码块高亮 图片链接和图片上传 LaTex数学公式 UML序列图和流程图 离线写博客 导入导出Markdown文件 丰富的快捷键 快捷键 加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl
Http post\get 发送表单
封装了<em>http</em><em>发送</em><em>post</em>,get请求,对于新手也是一个很好的学习参考资料,里面的文档里的网址有介绍<em>post</em>,get<em>发送</em>表单的区别
HTTP POST 发送文件示例程序
HTTPPOSTfile示例程序HTTPPOSTfile示例程序HTTPPOSTfile示例程序HTTPPOSTfile示例程序HTTPPOSTfile示例程序
http发送post和get请求
简单演示请求过程: get请求: HttpClient client=new DefaultHttpClient(); //HttpClient是个接口,由DefaultHttpClient完成实例化 HttpGet get=new HttpGet(url);//创建HttpGet对象,传入url进行实例化 HttpResponse response=client.excute(get);//Ht...
请问如何发送HTTP POST
关于HTTP POST的说明如下rnrn下面是一个 HTTP POST 请求和响应示例。所显示的占位符需要由实际值替换。rnrnPOST /WebTest/Service1.asmx/IntTest HTTP/<em>1.1</em>rnHost: localhostrnContent-Type: application/x-www-form-urlencodedrnContent-Length: lengthrnrna=string&b=stringrnHTTP/<em>1.1</em> 200 OKrnContent-Type: text/xml; charset=utf-8rnContent-Length: lengthrnrnrnintrnrn那么,我该如何才能调用这个HTTP POST,以及如何才能获得返回的结果呢?rn这个东东是C#架的一个WEB SERVICE,其中的一个函数rnrn初次接触这种东东,还请赐教。
用indy的idhttp上传一个文件,提示'HTTP/1.1 405 Method PUT is disabled on this server'错误
我用<em>id<em>http</em></em>控件想上传一个doc文件到服务器上,显示如下错误: rnraised exception class EIdHTTPProtocolException with message 'HTTP/<em>1.1</em> 405 Method PUT is disabled on this server'. Process stopped. Use Step or Run to continue.rn我把代码也贴出来:rnprocedure TForm1.Button1Click(Sender: TObject);rnvarrnUpLoadFile:TFileStream;rnbeginrn UpLoadFile:=TFileStream.Create('c:\oatemps\正文.doc',fmCreate);rn // DownLoadFile:=TFileStream.Create(LocalPath+'\lm.gif',fmCreate);rn tryrn idHttp1.Put('<em>http</em>://192.168.1.71/WordModule/test.doc',UpLoadFile);******rn exceptrn showMessage('上传失败');rn exit;rn end;rn showMessage('上传成功');rnend;rn执行到******那句出错.
http返回码401
查看得知:<em>401</em> - 未授权: 由于凭据无效,访问被拒绝。 代码其中一块需要读写文件,已经去掉只读,然后授权iis_users读写,解决问题。
delphi_rest与idhttppost提交
delphi_rest与<em>id<em>http</em></em>的<em>post</em>提交
idhttp post方法Demo
Delphi第三方组件<em>id<em>http</em></em> <em>post</em>方法的详细演示。 具体说明见:<em>http</em>://blog.csdn.net/none01/article/details/8657543
idhttp post数据的问题
我用同一个<em>id<em>http</em></em>组建,执行GET和POST操作,GET没问题,POST始终不对(获取数据包,失踪header不正确),请高手执教rnprocedure TForm1.Button1Click(Sender: TObject);rnvarrn xx:string;rn xxx:tstrings;rn yy:TMemoryStream;rn jpg:Tjpegimage;rnbeginrn <em>id<em>http</em></em>1.Request.Connection:='Keep-Alive';rn <em>id<em>http</em></em>1.Request.CacheControl:='no-cache';rn xxx:=tstringlist.Create;rn yy := TMemoryStream.Create ;rn xx:=IdHTTP1.Get('<em>http</em>://login.tom.com/captcha/drawme.php?type=6');rn xxx:=SplitString(xx,'=');rn IdHTTP1.Get('<em>http</em>://login.tom.com/captcha/draw.php?<em>post</em>_key='+stringreplace(xxx[8],';expires','',[rfReplaceAll])+'&type=6',yy);rn if StreamType(yy)='JPEG' then beginrn yy.Position:=0;rn tryrn Jpg:=tjpegimage.Create;rn Jpg.LoadFromStream(yy);rn image1.Picture.Graphic:= Jpg;rn finallyrn Jpg.Free;rn end;rn end else if StreamType(yy)='BMP' then beginrn yy.Position:=0;rn image1.Picture.Bitmap.LoadFromStream(yy);rn end else if StreamType(yy)='PNG' then beginrn rn end;rnend;rnrnprocedure TForm1.Button2Click(Sender: TObject);rnvarrn ParaList:tStringList;rn str:string;rnbeginrn ParaList:=tstringlist.Create;rn <em>id<em>http</em></em>1.Request.Connection:='Keep-Alive';rn <em>id<em>http</em></em>1.Request.CacheControl:='no-cache';rn <em>id<em>http</em></em>1.request.contenttype:='application/x-www-form-urlencoded';rn tryrn ParaList.Add('funcid=reguser');rn ParaList.Add('rf=060702');rn ParaList.Add('refer=<em>http</em>://mail.tom.com');rn ParaList.Add('year=1980');rn ParaList.Add('month=1');rn ParaList.Add('day=1');rn ParaList.Add('uid=fsdads35sdf');rn ParaList.Add('password=111111qq');rn ParaList.Add('confirm_password=111111qq');rn ParaList.Add('safemail=ad@asdf.com');rn ParaList.Add('authcode='+edit1.Text);rn ParaList.Add('argee=1');rn str:=<em>id<em>http</em></em>1.Post('<em>http</em>://bjcgi.tom.com/cgi-bin/tom_reg.cgi?rf=060702',paralist);rn WB_LoadHTML(WebBrowser1,str);rn finallyrn ParaList.Free;rn end;rnrnend;rnrn以上代码同样设置<em>id<em>http</em></em>1.Request.Connection:='Keep-Alive';rn但是GET获取的数据包header是正确的Connection: Keep-Alive,但是POST获取的数据包确是Connection: close,包括<em>id<em>http</em></em>1.Request.CacheControl:='no-cache';也没有生效
用adb 连接自己的小米手机提示 unauthorized
用adb 连接自己的手机失败,给的状态是<em>unauthorized</em> 这是问题源于adb增加了认证,连接的<em>时候</em>需要在弹出对话框进行确认 如果电脑安装的有豌豆荚之类的工具,基本就可以避免这个问题了,如果用adb Wireless这样的工具,可以试着多连接几次
关于http 401
使用<em>post</em>方法获取微博时间线,在不传递参数的情况下可以正常获取,传递参数则不行,取得StatusCode为<em>401</em>;rn代码如下:rn[code=Java]rnHttpClient client = new DefaultHttpClient();rnHttpPost <em>http</em>Request = new HttpPost(FRIENDS_TIMElINE_URL);rnorg.apache.<em>http</em>.HttpResponse response = null;rnconsumer.setTokenWithSecret(token, token_secret);rnconsumer.sign(<em>http</em>Request);rn rnList params = new ArrayList();rn//设置参数则出现<em>http</em> <em>401</em>rn//params.add(new BasicNameValuePair("count", "10"));rn//params.add(new BasicNameValuePair("page", "1"));rn rnHttpEntity entity = new UrlEncodedFormEntity(params, HTTP.UTF_8);rn<em>http</em>Request.setEntity(entity);rn rn<em>http</em>Request.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, false);rnresponse = client.execute(<em>http</em>Request);rn rnif(response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) rnresult = EntityUtils.toString(response.getEntity());rnrn[/code]
如何处理http 401
当遇到<em>401</em>认证信息后,怎么才能加入[truncated] Authorization: rnDigest username="用户名", realm="CMCC domain", rnnonce="af6a9no9W4", rnuri="/auth_web/applogon?service=%2Fmservices%2Fphone%2Fsecure%2Flogin.action", rnresponse="352304d192d0f5caf33e362f92f86fea", rnopaque="125443af6c7249" rn字段的内容
delphi idhttp 循环 Post
delphi <em>id<em>http</em></em> 循环 Post
delphi idhttp post = 乱码
平台 :windows 7 rnIDE; delphi xe 5rnrn使用<em>id<em>http</em></em>控件<em>post</em> 一个字符时,如果字符串里含有“=”号的话,再返回这个字符串的话,字符串里的“=”会变成 “3D”,怎么解决?
idhttp post mail163的问题
<em>id<em>http</em></em> <em>post</em> mail163的问题rnrnprocedure TForm1.Button1Click(Sender: TObject); rn var rn Response: TStringStream; rn <em>post</em>List: TStrings; rn beginrn Edit1.Text := '<em>http</em>://mail.163.com/';rn Response := TStringStream.Create('');rn <em>post</em>List := TStringList.Create;rn try rn <em>post</em>List.Add('username=我的用户名');rn <em>post</em>List.Add('userpwd=我的密码'); rn IdHTTP1.Post(Edit1.Text, <em>post</em>List, Response); rn finally rn Memo1.Lines.Text := Response.DataString; rn Response.Free; rn <em>post</em>List.Free; rn end; rn end;rnrnrnrn<em>post</em>以后 再memo中返回了 源码 如何判断依据登陆成功了呢 我返回的源代码 页没登陆<em>时候</em>的源码一样啊 ??rnrn求助
关于idhttp post的几个问题
感觉<em>id<em>http</em></em>问题很多rnrn1.在使用进度度显示上传进度时发现<em>id<em>http</em></em>多次调用了workbegin事件(好像3次),多次显示上传进度rn2.上传速度很慢rnrn如何解决以上问题?
IdHttp Post问题
今天使用IdHTTP控件,调用POST,提交数据到ASP网站,发现ASP页面获取不到这些提交的参数,请高手指点一下rn以下是C++的代码rn[code=C/C++]rn TIdHTTP *IdHTTP=new TIdHTTP(NULL);rn IdHTTP->HandleRedirects=true;rn AnsiString strRetData="";rn TStringStream *ResponseStream=new TStringStream("");rn AnsiString strURL="<em>http</em>://localhost/Register.asp";rn TIdMultiPartFormDataStream *s=new TIdMultiPartFormDataStream();rn s->AddFormField("Name","123");rn s->AddFormField("Telphone","123456789");rn s->AddFormField("EMail","123@qq.com");rn IdHTTP->Post(strURL,s,ResponseStream);rn strRetData=ResponseStream->DataString;rn ShowMessage(strRetData);rn delete ResponseStream;rn delete s;rn delete IdHTTP;rn[/code]rn以下是ASP页面的代码rn[code=VBScript]rndim strName,strTelphone,strEMailrnstrName=request.QueryString("Name")rnstrEMail=request.QueryString("EMail")rnstrTelphone=request.QueryString("Telphone")rnif strName="" or strTelphone="" or strEMail="" thenrn response.write "Data Error"rn response.end rnend ifrn[/code]rnrn不知为何,request.QueryString一直获取不到提交的参数,请懂得高手指点一下
idhttppost表单的问题
1、要<em>post</em>的页面里的变量有的是必填项,有的是可选的;是不是只要<em>post</em>页面里必填的变量就可以了?rn2、如何取得<em>post</em>后返回的数据?rn3、有没有比<em>id<em>http</em></em>好用的控件?
delphi idhttp post 网页
用<em>http</em>wath 抓包工具下来的提交数据rnrnPOST /login.php?forward=<em>http</em>%3A%2F%2Fmy.2345.com HTTP/<em>1.1</em>rnAccept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/msword, */*rnReferer: <em>http</em>://login.2345.com/login.php?forward=<em>http</em>%3A%2F%2Fmy.2345.comrnAccept-Language: zh-cnrnUser-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; QQDownload 714)rnContent-Type: application/x-www-form-urlencodedrnAccept-Encoding: gzip, deflaternHost: login.2345.comrnContent-Length: 135rnConnection: Keep-AlivernCache-Control: no-cachernCookie: goHd=; site_str=; localNav=; lastLogin=; sts=1; lc2=54511; wc=54511; lc=54511; wc_n=%25u5317%25u4EAC; gy=setM%2ClastLogin2012-9-3%252013%253A9%253A29%2C; name_ie=%25115%25121%25115%25116%25101%25109%25116%25101%25115%25116; validatenum=8b519f198dd26772e3e82874826b04aa; email=localhhost@localhost.localhost; ggbd=0; code_str=; mystyle_display=; theme=0; theme_logo=0; wc_sf=; __utma=6251595<em>1.1</em>042536828.1346641565.1346641565.1346641565.1; __utmz=6251595<em>1.1</em>346641565.<em>1.1</em>.utmcsr=2345.com|utmccn=(referral)|utmcmd=referral|utmcct=/; finished_online1161895=1; zcValue_u=08d017227bb3ec0145e88cebd20e9da4; zcValue_lo=4a584ce72b09f1b7f0c538b3a8bd9b28; iden=89c50900e524d1607f9ce370de255c44; PHPSESSID=ec1d3t12ruppmaell3obf44gq4; validatenum=046ddf96c233a273fd390c3d0b1a9aa4rnrncmd=login&forward=<em>http</em>%3A%2F%2Fmy.2345.com&password=54b53072540eeeb8f8e9343e71f28176&username=systemtest&pwd=system&check_code=&button=rnrnrn代码rnprocedure TForm1.Button2Click(Sender: TObject);rnVarrn Response:string;rn Paramstr:Tstringlist;rn IdHTTP1:T<em>id<em>http</em></em>;rnbeginrn IdHTTP1:=T<em>id<em>http</em></em>.create(nil);rn Paramstr:= TStringList.Create;rn Paramstr.Add('username=system');rn Paramstr.Add('password=systemtest');rnrn IdHTTP1.Request.Referer := '<em>http</em>://login.2345.com/login.php?forward=<em>http</em>%3A%2F%2Fmy.2345.com';rn IdHTTP1.Request.ContentType := 'application/x-www-form-urlencoded';rn IdHTTP1.Request.UserAgent := 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; QQDownload 714)';rn IdHttp1.Request.SetHeaders;rn IdHttp1.Request.CustomHeaders.add('Cookie: goHd=; site_str=; localNav=; lastLogin=; sts=1; lc2=54511; wc=54511; lc=54511; wc_n=%25u5317%25u4EAC; gy=setM%2ClastLogin2012-9-3%252013%253A9%253A29%2C;');rn IdHttp1.Request.CustomHeaders.add(' name_ie=%25115%25121%25115%25116%25101%25109%25116%25101%25115%25116; validatenum=8b519f198dd26772e3e82874826b04aa; email=localhhost@localhost.localhost; ggbd=0; ');rn IdHttp1.Request.CustomHeaders.add('code_str=; mystyle_display=; theme=0; theme_logo=0; wc_sf=;');rn IdHttp1.Request.CustomHeaders.add(' __utma=6251595<em>1.1</em>042536828.1346641565.1346641565.1346641565.1; __utmz=6251595<em>1.1</em>346641565.<em>1.1</em>.utmcsr=2345.com|utmccn=(referral)|utmcmd=referral|utmcct=/;');rn IdHttp1.Request.CustomHeaders.add(' finished_online1161895=1; zcValue_u=08d017227bb3ec0145e88cebd20e9da4; zcValue_lo=4a584ce72b09f1b7f0c538b3a8bd9b28; iden=89c50900e524d1607f9ce370de255c44;');rn IdHttp1.Request.CustomHeaders.add(' PHPSESSID=ec1d3t12ruppmaell3obf44gq4; validatenum=046ddf96c233a273fd390c3d0b1a9aa4');rn IdHttp1.Request.CustomHeaders.add('cmd=login&forward=<em>http</em>%3A%2F%2Fmy.2345.com&password=54b53072540eeeb8f8e9343e71f28176&username=systemtest&pwd=system&check_code=&button=');rn Response:=IdHTTP1.Post('<em>http</em>://login.2345.com/login.php?forward=<em>http</em>%3A%2F%2Fmy.2345.com', Paramstr);rn showmessage(Response);rn Freeandnil(IdHTTP1);rn Paramstr.Free;rnrnend;rnrn提交总是不成功rnrn测试账号:systemrn测试密码:systemtestrn测试网址:<em>http</em>://login.2345.com/login.php?forward=<em>http</em>%3A%2F%2Fmy.2345.comrnrn
idhttp post例子
找了半天没有<em>post</em>例子,谁能发个,小弟学习下!!!rnrn小弟感激不尽啊!!!
IdHTTP post 数据的问题.
用IdHTTP控件向一个网站提交数据,达到留言的功能.没有成功.rnrn/////////////////////////////////////////////////////////////////////////rn用HttpWatch 监视IE中我自己的账号向我自己的页面发表留言时的数据如下(网址用xxxxx代替)rnrn流标签的内容rn<em>发送</em>的:rnrnPOST /gossip.do HTTP/<em>1.1</em>rnAccept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*rnReferer: <em>http</em>://xxxxx.com/getuser.do?id=42531288rnAccept-Language: zh-cnrnContent-Type: application/x-www-form-urlencodedrnAccept-Encoding: gzip, deflaternUser-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Maxthon; .NET CLR <em>1.1</em>.4322)rnHost: xxxxx.comrnContent-Length: 58rnConnection: Keep-AlivernCache-Control: no-cachernCookie: cookieuniv=3002; __utma=204579609.1582353597.1168328182.1168331565.1168331780.7; __utmb=204579609; __utmz=204579609.1168328182.<em>1.1</em>.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); wh_email=weixing979@163.com; wh_key=a65cf3dfa63ba2297ebda4e86e6c9702; email=weixing979@163.com; password=95307607428ce336e2da99049fe41262; mop_uniq_ckid=218.9.160.142_1168329779_1721375101; societyid=6c202d413ed572e4cc4164a8e76912fe116eae775a6a294a; JSESSIONID=abcm0HjDU1fcp7k8bagar; __utmc=204579609rnrncurpage=&from=main&id=42531288&cc=42531288&body=1234567890rnrn接收到的:rnHTTP/<em>1.1</em> 302 FoundrnServer: Resin/3.0.21rnVary: Accept-EncodingrnLocation: <em>http</em>://xxxxx.com/getuser.do?id=42531288&#starttalkrnContent-Type: text/htmlrnContent-Length: 90rnConnection: closernDate: Tue, 09 Jan 2007 08:36:45 GMTrnrnThe URL has moved herernrnrn摘要标签的内容:rnrn提交表单 浏览器提交值到 <em>http</em>://xxxxx.com/gossip.do CompletedrnStarted At 2007-Jan-09 16:36:48.718 (local time) CompletedrnConnect 连接到 IP 地址 'XX.XX.XXX.XXX' CompletedrnHTTP Request 无条件<em>发送</em>此请求 <em>http</em>://xxxxx.com/gossip.do CompletedrnHTTP Response 返回标题和内容 Completedrn改向 改向到 <em>http</em>://xxxxx.com/getuser.do?id=42531288&#starttalk 由服务器造成rnrnrn/////////////////////////////////////////////////////////////////////////rnrn网页中留言部分的代码rn rn rn rn rn rn (每条最多2000字)rn rn rn rn rn rn rn rn rnrnrnrnrn/////////////////////////////////////////////////////////////////////////rnrnBCB程序的<em>发送</em>代码:rnrnIdHTTP1->Request->ExtraHeaders->Values["cookie"] = cookie;rnrn IdHTTP1->HandleRedirects = true;rn IdHTTP1->Request->Referer = "<em>http</em>://xxxxx.com/getuser.do?id=42531288";rn IdHTTP1->Request->AcceptLanguage = "zh-cn";rn IdHTTP1->Request->ContentType = "application/x-www-form-urlencoded";rn IdHTTP1->Request->AcceptEncoding = "gzip, deflate";rn IdHTTP1->Request->UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR <em>1.1</em>.4322)";rn IdHTTP1->Host = "xxxxx.com";rn IdHTTP1->Request->ContentLength = 58;rn IdHTTP1->Request->Connection = "Keep-Alive";rnrnrnrnrn AnsiString url = "<em>http</em>://xxxxx.com/gossip.do";rnrn TStrings* tData=new TStringList();rnTStringStream* stream=new TStringStream("");rn tData->Add("curpage=");rn tData->Add("from=main");rn tData->Add("id=42531288");rn tData->Add("cc=42531288");rn tData->Add("body=1234567890");rn IdHTTP1->Post(url,tData,stream);rn Memo1->Text = stream->DataString;rnrn用这些代码没有<em>发送</em>成功. 另外BCB中用到的cookie是我在程序中放了一个CppWebBrowser,登录后获得的cookie,用这个cookie可以Get出正确的页面.rnrn大家看一下是什么问题rn
idhttp post百度问题
procedure TForm1.btn1Click(Sender: TObject);rnvarrn Param:TStringList;rn RStream:TStringStream;rnbeginrn Param:=TStringList.Create;rn RStream:=TStringStream.Create('');rn rn Param.Add('username=showlee000');rn Param.Add('normModPsp=********');rn Param.Add('mem_pass=true');rn IdHTTP1.Post('<em>http</em>://passport.baidu.com/?login&tpl=mn',rn Param,RStream);rnrn mmo1.Text:=RStream.DataString;rnend;rnrn--------------------下面是登陆界面核心代码--------------------rn rn 用户名:rn rn rn rn 密 码:rn rn rnrn为什么登陆不成功?rn Param.Add('normModPsp=********');改成 rn Param.Add('password=********');就能成功rnrn这是为什么
delphi idhttp post 的问题
rnrnrn网站上select中的内容不显示rn那么我如何<em>post</em>这个值呢?
IdHTTP Post 编码的问题
delphi 2007 IdHTTP Post 编码的问题rnrnrnrn[code=Delphi(Pascal)] rnvarrn Param:TStringList;rn..rn..rn..rnIdHTTP.HTTPOptions:=OneCodeIdHTTP.HTTPOptions+[hoKeepOrigProtocol];rn//ShowMessage(Param.Text); 这里Show出来的 确实是我想要的格式 比如:“%22%29”rnIdHTTP.Post('URL',Param,RStream);rn//但是Post之后,用WSockExpert抓包,格式却变了 变成了“%2522%2529”rn..rn..rn..rn[/code]rnrnrn求相关解决方法??
idhttppost问题。
我需要做一个注册账号的软件。rn[color=#FF0000]PS:是公司要求的,不是做挂什么的,请大家不要误会。[/color]rnrn我是使用<em>id<em>http</em></em>来做的rnprocedure TForm1.Button1Click(Sender: TObject);rnvarrn ms: TMemoryStream;rn png:TdxPNGImage;rnbeginrn ms:=TMemoryStream.Create;rn png:=TdxPNGImage.Create;rn IdHTTP1.Get('<em>http</em>://www.jxds.gov.cn/wssw/jsp/includes/zcyzm.jsp',ms);rn ms.Position := 0;rn png.LoadFromStream(ms);rn Image1.Picture.Assign(png);rnend;rnrn目前验证码是能成功提取到了。rnrn而<em>post</em>,也通过<em>http</em>watch抓到了,但是本人对这方面的编程借进与小白- -rnrn这是<em>http</em>watch抓到的Post data 中的xml文件rn[code=XML]rn[/code]rnrn但是我在Delphi中,直接提交,虽然没有报错,但是返回的都是空的,按理说,注册失败的话,总会有因为什么原因注册失败的。但是我不晓得我哪里设置错了,或者什么问题,每次返回都是空,试了好多方法。rnrn方法1:直接提交抓包的xml。rn[code=Delphi(Pascal)]rn str:=TStringList.Create;rn XML1:=TXMLDocument.Create(nil);rn XML1.LoadFromFile('xml.XML');rn str.Add(XML1.XML.Text);rn IdHTTP1.Post('<em>http</em>://www.jxds.gov.cn/wssw/sbController.do?cmd=glfw_qy_zc',str,str1);rn showmessage(UTF8Decode(str1.DataString));[/code]rn返回空值- -rnrn方法2:自己写stringlist的内容提交,请教别人后告诉我,提交网页代码Form后面的部分。rn[code=Delphi(Pascal)]rn str:=TStringList.Create;rn str1:=TStringStream.Create('');rn str.Add('rootVo.properties*nsrglm='+'11111111');rn str.Add('rootVo.properties*taxregcode='+'36111111111101');rn str.Add('rootVo.properties*frdb='+'颜德');rn str.Add('rootVo.properties*register_name='+'颜德');rn str.Add('rootVo.properties*password='+'111111');rn str.Add('passwordConfirm='+'111111');rn str.Add('rootVo.properties*password_question='+'123456');rn str.Add('rootVo.properties*password_answer='+'123456');rn str.Add('rootVo.properties*yzm='+Edit1.Text); rn IdHTTP1.Post('<em>http</em>://www.jxds.gov.cn/wssw/sbController.do?cmd=glfw_qy_zc',str,str1);rn showmessage(UTF8Decode(str1.DataString)); rn[/code]rnrn还是返回空。。rnrn方法3:我不晓得rootVo.properties*这一段是什么意思- -(本人主要工作于C/S模式的管理软件编程,对网络编程完全的小白。)所以我决定去掉,提交试试。rn[code=Delphi(Pascal)]rn str:=TStringList.Create;rn str.Add('nsrglm='+'11111111');rn str.Add('taxregcode='+'36111111111101');rn str.Add('frdb='+'颜德');rn str.Add('register_name='+'颜德');rn str.Add('password='+'111111');rn str.Add('passwordConfirm='+'111111');rn str.Add('password_question='+'123456');rn str.Add('password_answer='+'123456');rn str.Add('yzm='+Edit1.Text); rn IdHTTP1.Post('<em>http</em>://www.jxds.gov.cn/wssw/sbController.do?cmd=glfw_qy_zc',str,str1);rn showmessage(UTF8Decode(str1.DataString)); rnrn[/code]rnrn返回还是空0.0rnrn还尝试过把xml转换成stringstream<em>发送</em>,返回也是空。。。空!空!空! 搞了2天了,百度了N多内容,看别人写都这么简单,可是我就是搞不懂为什么我提交不了。。。请高手指点。。万分感谢。
http post 发送xmlstr的时候特殊符号都被转换成%3C%3了
<em>http</em> <em>post</em> <em>发送</em>xmlstr如下rn[code=java]rn//要<em>发送</em>的xmlstrrn8373042fd87b012edac59cb5189cd1c413800138014999932110900068042rn[/code]rn我格式都设置utf-8rn[code=java]rn <em>post</em>.addHeader("content-Type", "multipart/form-data;charset=utf-8");rn //<em>post</em>.addHeader("content-Type", "application/x-www-form-urlencoded");rn List params = new ArrayList();rn //发起叠加订购rn try rn //params.add(new BasicNameValuePair("xmlhead", new String(YiDongXML.mapToXmlHeadRequest(maphead).getBytes("utf-8"),"utf-8")));rn params.add(new BasicNameValuePair("xmlbody", new String(YiDongXML.mapToXmlBodyOverlayRequest(mapbody).getBytes("utf-8"),"utf-8")));rn System.out.println("utf-8================="+new String(YiDongXML.mapToXmlHeadRequest(maphead).getBytes("utf-8"),"utf-8"));rn System.out.println("utf-8================="+new String(YiDongXML.mapToXmlBodyOverlayRequest(mapbody).getBytes("utf-8"),"utf-8"));rn catch (Exception e)rn try rn UrlEncodedFormEntity entity = new UrlEncodedFormEntity(params,"utf-8");rn <em>post</em>.setEntity(entity);rn // 4. 执行请求并处理响应rn CloseableHttpResponse responsess = <em>http</em>Client.execute(<em>post</em>);rn[/code]rn但是接收的<em>时候</em>特殊字符还是被转成%3D等rn[code=java]rn%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0A%3CInterBOSS%3E%3CSvcCont%3E%3C%21%5BCDATA%5B%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%3CAdditionInfo%3E%3CProductID%3E8373042fd87b012edac59cb5189cd1c4%3C%2FProductID%3E%3CUserData%3E%3CMobNum%3E13800138014%3C%2FMobNum%3E%3CUserPackage%3E999932110900068042%3C%2FUserPackage%3E%3C%2FUserData%3E%3C%2FAdditionInfo%3E%5D%5D%3E%3C%2FSvcCont%3E%3C%2FInterBOSS%3Ern[/code]rn请问有没有大佬知道这个要怎么解决吗?只能在<em>发送</em>方这边解决
idhttp六种post方法
分享一个示例代码,这是从网上下载的delphi7,六种idHttp.<em>post</em>的方法,经测试验证,可用,需在delphi7 IDE环境里安装indy idHttp控件,否则会打不开
idhttp控件的post编码问题
最近在做一个发贴工具,用的是delphi2010 indy10 ,论坛是discuz big5码,登陆没问题,但是发贴时,贴子内容是乱码。rn发贴函数如下:rnrnFunction TForm1.<em>post</em>info(url, subject, wsmessage,fid: string): Boolean;rnvarrnParam:TStringList;rngeturl:String;rn Response:TStringStream;rnbeginrnResult:=False;rngeturl:=url+'/index.php';rn//rnrn<em>id<em>http</em></em>1.AllowCookies:=True;rn<em>id<em>http</em></em>1.HandleRedirects:=True;rn//<em>id<em>http</em></em>1.Request.Accept:='image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*';rn <em>id<em>http</em></em>1.Request.Referer:=url+'/<em>post</em>.php?action=newthread&fid='+fid;rn IdHTTP1.HTTPOptions:=IdHTTP1.HTTPOptions+[hoKeepOrigProtocol];rn<em>id<em>http</em></em>1.Request.AcceptLanguage:='zh-cn';rn<em>id<em>http</em></em>1.Request.ContentType:='application/x-www-form-urlencoded' ;rn<em>id<em>http</em></em>1.Request.AcceptEncoding :='gzip, deflate';rn<em>id<em>http</em></em>1.Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 2.0.50727)';rn <em>id<em>http</em></em>1.Request.Connection:='keep-alive';rnrn <em>id<em>http</em></em>1.Request.CacheControl:='no-cache';rnrnrnParam:=TStringList.Create;rnResponse:=TStringStream.Create('');rntryrnwsmessage:=ansitoutf8(wsmessage);rnparam.Clear;rnParam.Add('formhash='+formhash);rnparam.Add('wysiwyg=0');rnParam.Add('subject='+subject);rnParam.Add('message='+wsmessage);rnparam.Add('iconid=');rnparam.Add('addfeed=1');rnparam.Add('topicsubmit=%B5o%B7s%B8%DC%C3D');rn//Param.Add('userlogin=%E7%99%BB%E5%BD%95');rnurl:=url+'/<em>post</em>.php?action=newthread&fid='+fid+'&extra=&topicsubmit=yes';rntryrn <em>id<em>http</em></em>1.Post(url,param,response); rn rn exceptrn showmessage('发贴失败');rn end;rnfinallyrn Param.Free;rn response.Free;rnend;rn showmessage(response.DataString);rnrnend;rn
IdHttp post 一个html
[b][color=#FF0000]HTML:[/color][/b]rn[code=HTML]rnrn 无标题页rnrnrn rn rn 用户:rn rn rn 密码:rn rn rn rn rn rn rn rn rn rn rnrnrn[/code]rnrnrn[color=#FF0000][b]ASP.NET[/b][/color]rn[code=C#]public partial class _info : System.Web.UI.Pagernrn protected void Page_Load(object sender, EventArgs e)rn rn string strName = Request.Form["user"];rn string strPwd = Request.Form["password"];rn Response.Write("user=" +strName);rn Response.Write(" ");rn Response.Write("password=" +strPwd);rn rn[/code]rnrnrn[b][color=#FF0000]请问用IdHttp如何提交数据?[/color][/b]rnrnrnrn
IdHttp重定向POST错误
设置HandleRedirects = true;rn向服务器发POST,被重定向,这时正确的方式是GET重定向网址,rn但是IdHttp竟然采用POST方式向重定向网址再次提交了用户名和密码,导致错误的返回rn我用的是Indy8.0,改为9.0就好了吗?
算法经典教程下载
麻省理工经典算法著作,是计算机专业的基础,没事的时候,多看看。 相关下载链接:[url=//download.csdn.net/download/zouyunchuan624/8923553?utm_source=bbsseo]//download.csdn.net/download/zouyunchuan624/8923553?utm_source=bbsseo[/url]
windows进程端口查看工具下载
windows平台下,查看进程和端口对应关系的工具。小巧易用。 前往http://download.csdn.net/source/2929669下载最终版。 相关下载链接:[url=//download.csdn.net/download/captainivy/2929320?utm_source=bbsseo]//download.csdn.net/download/captainivy/2929320?utm_source=bbsseo[/url]
hibernateAPI下载
hibernate帮助文档,中文API,帮助你查找更方便 相关下载链接:[url=//download.csdn.net/download/w2j7163com/4278244?utm_source=bbsseo]//download.csdn.net/download/w2j7163com/4278244?utm_source=bbsseo[/url]
相关热词 c# 去空格去转义符 c#用户登录窗体代码 c# 流 c# linux 可视化 c# mvc 返回图片 c# 像素空间 c# 日期 最后一天 c#字典序排序 c# 截屏取色 c#中的哪些属于托管机制
我们是很有底线的