IWEB_GetResponse返回status code:400? [问题点数:30分]

Bbs1
本版专家分:0
结帖率 90.57%
Bbs1
本版专家分:0
Bbs1
本版专家分:0
求救,IWEB_GetResponse返回AEE_NET_ENETNONET错误
各位高手,我调用IWEB_GetResponse并设置了WEBOPT_PROXYSPEC, " http:///http://10.0.0.200:80" 代理,当第一次进行连接时<em>返回</em> AEE_NET_ENETNONET 这个错误,以后再进行连接就<em>返回</em> WEB_ERROR_CONNECT 这个错误,要怎么解决呀。rnrn注:不设置代理时连接正常,可我要访问的网站需要通过这个代理才行rn
HTTP Status 400服务器返回400啥意思
由于语法格式有误,服务器无法理解此请求。不作修改,客户程序就无法重复此请求。
AJAX上传图片失败,前端显示Status Code:400 Bad Request
springboot由1.2.1升级为1.3.3产生的全新问题,AJAX上传图片老是<em>400</em>,Status Code:<em>400</em> Bad Requestrnrn前端代码:rn[<em>code</em>=javascript]rn rn 选择合适的图片上传rn rn rn rn 上传图片格式为 jpg、png格式,图片不得大于MBrn rn rn rn rn rn rn 取消rn 确认rn rnrn rn[/<em>code</em>]rn后台代码:rn[<em>code</em>=java]rn@Controllerrn@RequestMapping("/upload/")rnpublic class UploadImageController rn @RequestMapping(value = "image" , method = RequestMethod.POST , RequestMethod.GET)rn @ResponseBodyrn public Map doUploadImage(@RequestParam("imgUpload") MultipartFile file ,rn @RequestParam(value = "uploadTable" , required = false)String uploadTable )rn Map result = new HashMap();rn try rn //上传图片rn String name = this.aliyunUtils.uploadFile(file, uploadTable+"/"+NameUtils.getDisposeUUID() + "." + ImageTypeUtils.getExtName(file.getOriginalFilename()));rn this.uploadServiceCRU.doSaveImg(name, uploadTable);rn result.put("success", true);rn result.put("imgUrl", constantIP.getImgIp() + name);rn catch (Exception e) rn logger.error(e.getMessage(),e);rn result.put("success", false);rn result.put("<em>code</em>", "500");rn result.put("mgs", "图片存储失败,请重新尝试");rn rn return result;rn rnrn[/<em>code</em>]rnrn为了解决此问题,我特意将原生ajax换成了jQuery,此时显示的错误是rn[<em>code</em>=java]rn- 触发请求:[/upload/image]时系统出现异常,异常类型:系统异常,异常信息:The current request is not a multipart requestrn10:07:45.557 [http-nio-30161-exec-5] ERROR c.u.y.w.e.h.SystemExceptionHandler:52 - org.springframework.web.multipart.MultipartException: The current request is not a multipart requestrn at org.springframework.web.method.annotation.RequestParamMethodArgumentResolver.assertIsMultipartRequest(RequestParamMethodArgumentResolver.java:216)rn at org.springframework.web.method.annotation.RequestParamMethodArgumentResolver.resolveName(RequestParamMethodArgumentResolver.java:167)rn at org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:90)rn at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:99)rn at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:161)rn at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.javrn[/<em>code</em>]rnrn我用了Postman模拟发送请求的时候,上传的file显示为空,所以我确定是后台的接口出了问题,而不是前端。rn[img=https://img-bbs.csdn.net/upload/201702/13/1486952532_641103.png][/img]rn而我Springboot1.2.1的时候上传功能是正常的,现在没法用了,我怀疑是jar包不兼容或者是jar包版本出了问题。rn现在贴出jar包图片,求大神指导rn[img=https://img-bbs.csdn.net/upload/201702/13/1486952290_465014.png][/img]rn[img=https://img-bbs.csdn.net/upload/201702/13/1486952301_665167.png][/img]rn[img=https://img-bbs.csdn.net/upload/201702/13/1486952312_956155.png][/img]rn[img=https://img-bbs.csdn.net/upload/201702/13/1486952322_333977.png][/img]rn[img=https://img-bbs.csdn.net/upload/201702/13/1486952334_168977.png][/img]
DataStage Status Code
现在想获得DS作业运行完成之后<em>返回</em>的Status Code的值,要根据<em>返回</em>的值是不是0进行判断下一步操作,现在的难题是,不知道怎么获得Status Code,求指教
symtec netbackup status code
symtec netbackup <em>status</em> <em>code</em>
响应状态码 status code
202: 成功 302: 临时转移至新的url 307: 临时转移至新的url 404: not found 500: 服务器内部错误
http status 400怎么解决
我安装的是tomcat 4.1,系统采用structs技术,我运行一块程序时出现http <em>status</em> <em>400</em>rn不知道什么原因,怎么解决,多谢!
fsocket 返回status问题
提交资料到指定的网址rn"/checking/"下有index.php echo "success"rnrn"/checking/" 成功<em>返回</em>HTTP/1.1 200rn"/checking" <em>返回</em>HTTP/1.1 301 rnrn伺服器是Apache的,可以不用“/”也<em>返回</em>200吗rnrn[<em>code</em>=PHP]rn$host = "127.0.0.1";rn$port = 8088;rn$script = "/checking/";rnrn$request = "";rn$request .= "username=testing&";rn$request .= "password=123456";rnrn//build headerrn$header = "POST $script HTTP/1.1\r\n";rn$header .= "Host: $host\r\n";rn$header .= "Content-Type: application/x-www-form-urlen<em>code</em>d\r\n";rn$header .= "Content-length: ".strlen($request)."\r\n";rn$header .= "Connection: close\r\n\r\n";rnrn$debug.="Host: ".$host." ";rn$debug.="Port: ".$port." ";rn$debug.="Requset: ".$request." ";rnrn$socket = fsockopen($host, $port, $errno, $errstr, 30);rn$output=array();rnif($socket)rn fputs($socket, $header.$request);rn $debug.="Response: ";rn while(!feof($socket))rn $data=fgets($socket);rn $debug.=$data;rn rnecho $debug;rn fclose($socket);rnrnrn[/<em>code</em>]
爬虫Status Code: 304解决方案
具体网页不公布了: 问题: 打印的结果: print(resp.<em>status</em>_<em>code</em>) print(111,resp.content.de<em>code</em>()) 304 111 这让我很诧异,因为我也是第一次遇见304,不知道如何下手,就百度谷歌搜索结果,看看有没有解决方法: 最后找到了一些304的原理文章 https://blog.csdn.net/soonfly/article/details...
关于status返回问题
这个例子是在中的,可是我实现不了rnrnrnrn Usingrn rnrnrn rn rnrnrnrnrn1.XML如下rnrnrn rn Minnesotarn Iowarn North Dakotarn rn rn Texasrn Oklahomarn Louisianarn rn rn New Yorkrn North Carolinarn Massachusettsrn rn rn Californiarn Oregonrn Nevadarn rnrn现在就是点BUTTON没有反应rn但是我要把xmlHttp.<em>status</em> == 200改为xmlHttp.<em>status</em> != 200的话可以,但是会显示var northStates = northNode.getElementsByTagName("state");有错误,说"没有<em>返回</em>值或NULL为空",不知道为何rn
HttpQueryInfo 返回400
[<em>code</em>=C/C++]rnrn DWORD dwStatusCode = 0;rn DWORD dwSizeOfRq = 4;rnrn if (!HttpQueryInfo(hRequestrn ,HTTP_QUERY_FLAG_NUMBER | HTTP_QUERY_STATUS_CODErn ,(LPVOID)&dwStatusCodern ,&dwSizeOfRqrn ,NULL))rn rn //查詢發送請求后,服務器后<em>返回</em>消息rn dError = ::GetLastError();rn SetFormatData(m_Error,"HttpQueryInfo Fail Error Code is %d",dError);rn dwStatusCode = 0;rn bIsOK = false;rn goto EndFlg;rn rnrn[/<em>code</em>]rn为什么dwSizeOfRq <em>返回</em>是<em>400</em>rnrn同样的代码rnrnhttp://www.qq.comrn<em>返回</em>是200rn而rnhttp://www.csdn.net是<em>400</em>rnrn有谁能告诉我原因,谢谢
客户端返回400错误
今天测试终端连接服务器,<em>返回</em><em>400</em>错误,定位了一下,是终端post请求问题。我们post的数据是json格式的,但是Content-Type却是application/x-www-form-urlen<em>code</em>d,把Content-Type改为application/json就搞定了。
wcf返回400错误
进程承载wcf服务,webget方式。rn如果浏览器访问地址是:rnhttp://127.0.0.1:8001/MyServerService/MessageDispatch/"Code":"","IsCode":"0","Msg":"RSAKeyValueModulus1Ly3O9RxhK5riOUvTeC63PtGcxOZUy2cwj2NEqhT7LzAiXihzgDmpStljR2BchxsGSGsnwFyx7jZX9hnkLyVerZVer6s67VlkLQFyRSJQ3BVD6lm0LMEIV0LvrDRfiabfWIHqR87gJlNpjzK","MsgType":"LoadInfo","Receiver":null,"Sender":null,"cuTime":nullrn正常;rnrn如果是:rnhttp://127.0.0.1:8001/MyServerService/MessageDispatch/"Code":"","IsCode":"0","Msg":"RSAKeyValueModulus1Ly3O9RxhK5riOUvTeC63PtGcxOZUy2cwj2NEqhT7LzAiXihzgDmpStljR2BchxsGSGsnwFyx7jZX9hnkLyVerZVer6s67VlkLQFyRSJQ3BVD6lm0LMEIV0LvrDRfiabfWIHqR87gJlNpjzK1","MsgType":"LoadInfo","Receiver":null,"Sender":null,"cuTime":nullrn<em>返回</em><em>400</em>错误,任何多一个字符就报错。rnrnrnrn
jsoup 返回400错误分析
今天在用jsoup验证700多个网址是否能正常显示打开的时候,发现好多都<em>返回</em>了<em>400</em>状态码,手动打开这部分<em>返回</em>状态码的网址,发现部分是<em>返回</em>的404,部分能正常显示。真是奇怪了。然后google了一下,<em>400</em>到底是什么错误。<em>400</em>:(错误请求) 服务器不理解请求的语法。因为PM急着要结果,果断换成selenium,判断页面标题是否有NOT FOUND,结果正常。       完后,再看这个<em>400</em>...
URL.openStream()返回400错误
[<em>code</em>=java]String urlString="http://book.zongheng.com/quanben/c0/c0/b9/u1/p1/v0/s1/t0/ALL.html";rnURL url=new URL(urlString);rnInputStream is = url.openStream();[/<em>code</em>]rnrn[color=#FF0000][size=16px][b]上面的网址在浏览器中可以直接打开,为何代码却总是出现<em>400</em>错误呢?rnrn但有的网址代码却是可以运行的?访问网页内容到底改用什么方法?谢谢大家!!![/b][/size][/color]
HTTP Status 400 - Invalid path 散分
哪位高手帮忙我解决一下,rnrn我在本机上编写了一段程序,在本机上运行没有问题,rnrn然后我的程序与别人的合并在一起,没有用CVS,直接rnrnCOPY的,struts-config.xml文件里的action也COPYrnrn到了一个文件里,然后运行,在请求action的时候报rnrnrnrnHTTP Status <em>400</em> - Invalid path /company/dept was requestedrnrn--------------------------------------------------------------------------------rnrntype Status reportrnrnmessage Invalid path /company/dept was requestedrnrndescription The request sent by the client was syntactically incorrect (Invalid path /company/dept was requested).rnrn我的配置我自认为肯定没问题,请问哪们大虾知道tomcat有什么别的rnrnbug吗?(配置正确,但是tomcat却不能正确执行),郁闷斗天了,谢谢哪rnrn帮帮忙!!!!!
IWEB_GetResponse() 怎么传参数……
服务器端接收手机传递过去的参数来把消息传给手机。。。rnrnrnrn服务端接收消息格式:HTTP://www.*****.com/abc?cb=参数(1),pd=参数(2) rnrnrnrn由于参数1,2 是手机变量中产生的。。。。rnrnrnvoid IWEB_GetResponse rnrn(rnIWeb *pIWeb, rnIWebResp **ppiwresp, rnAEECallback *pcb, rnconst char *cpszUrl, rn... rnrn) rnrnrnapi里const char *cpszUrl,不能改变cpzUrl。。这种方式不好。。rnrnrn但用POST,服务器端只接收url传过来的消息。。其他的不接受。。rnrn怎么办??
IWEB_GetResponse通过wap访问的问题
在模拟器上通过 IWEB_GetResponse 能得到服务器的数据, 但是在手机上就不行了.rn估计是因为手机只能通过wap访问网络.rn这种情况下还能通过 IWEB_GetResponse 得到服务器数据吗? 服务器上就是一个xml文件.rn是不是要通过手机设置的代理访问?rnrn有人有办法吗?谢谢!
用 IWEB_GetResponse 获得数据的编码问题
现在的问题:用 IWEB_GetResponse 发送一个请求, 回调函数中使用IWEBRESP_GetInfo 得到一个 WebRespInfo 的指针.但是这个指针里的数据部分ISource *pisMessage和服务器上的数据是不一样的.rn服务器上使用utf-8编码, 本地这些数据好像进行了解码,但是解析不了utf-8,英文部分是没问题的,双字节码变成单字节, 但是中文部分全乱了,完全不对.rn有人在这方面有经验吗?rn服务器端现在是不能变的, 怎么在客户端得到正确的数据呢?rnrn谢谢.
HttpWebRequest发送json数据返回400
HttpWebRequest发送json数据<em>返回</em><em>400</em>,但是用post接口测试工具测试<em>返回</em>正常数据
SpringMVC 表单提交 页面返回400
原因:表单提交中有时间参数,时间参数没有被格式化。 解决方法:用注解格式化时间参数。 类似如下:  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")   private java.util.Date endTime ;
HttpClient4.3.5抓取网页返回400问题
我用C写的抓取请求头信息是这样的,能抓到,<em>返回</em>200rnGET / HTTP/1.1rnHost: www.moa.gov.cnrnReferer: http://www.moa.gov.cnrnAccept-Encoding: gzip,deflate,sdch,brrnCache-Control: no-cache,max-age=0rnPragma: no-cachernConnection: closernUpgrade: 1rnUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36rnrnrn用java写的请求头信息是这样的,抓不到,<em>返回</em><em>400</em>rnGET http://www.moa.gov.cn HTTP/1.1rnReferer: http://www.moa.gov.cnrnAccept-Encoding: gzip,deflate,sdch,brrnCache-Control: no-cache,max-age=0rnPragma: no-cachernConnection: closernUpgrade: 1rnUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36rnrnrnjava代码:rnrequest = new HttpGet(url);rn request.setHeader(HttpHeaders.HOST,"www.moa.gov.cn");rn request.setHeader(HttpHeaders.REFERER,"http://www.moa.gov.cn");rn request.setHeader(HttpHeaders.ACCEPT_ENCODING, "gzip,deflate,sdch,br");rn request.setHeader(HttpHeaders.CACHE_CONTROL, "no-cache,max-age=0");rn request.setHeader(HttpHeaders.PRAGMA, "no-cache");rn request.setHeader(HttpHeaders.CONNECTION,"close");rn request.setHeader(HttpHeaders.UPGRADE, "1");rn request.setHeader(HttpHeaders.USER_AGENT, "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36");rnresponse = httpClient.execute(request);rn跪求大牛解惑
ModBus返回HTTP/1.1 400
第一次做这个,里面有些不懂; 下面错在哪里,请大虾们指出来,小弟先谢过了...rnrn public partial class Form1 : Form,IDisposablern rn string IP = "127.0.0.1";rn int Port = 80;rn int TimeOut = 1000;rn byte dataIndex = 0;//事务标识rn short StartingAddress = 0;//起始地址rn Socket socket = null;rnrn public Form1()rn rn InitializeComponent();rn rnrn private void btnSend_Click(object sender, EventArgs e)rn rn Send(Encoding.UTF8.GetBytes(this.textBox1.Text.Trim()));rn rnrn public void Send(byte[] data)rn rn //[0]:填充0,清掉剩余的寄存器rn if (data.Length < 60)rn rn var input = data;rn data = new Byte[60];rn Array.Copy(input, data, input.Length);rn rn //[1]:连接主机rn this.Connect();rn //[2]:数据包rn List values = new List(255);rn values.AddRange(ValueHelper.Instance.GetBytes(this.NextDataIndex())); //1.事务标识rn values.AddRange(new Byte[] 0, 0 ); //2.协议标识符,0 = MODBUS 协议rn values.AddRange(ValueHelper.Instance.GetBytes((byte)(data.Length + 7))); //3.后续的Byte数量rn values.Add(0); //4.单元标识rn values.Add((byte)16); //5.功能码(16表示往寄存器中写值)rn values.AddRange(ValueHelper.Instance.GetBytes(StartingAddress)); //6.起始地址rn values.AddRange(ValueHelper.Instance.GetBytes((short)(data.Length / 2)));//7.寄存器数量rn values.Add((byte)data.Length); //8.字节个数rn values.AddRange(data); //9.增加要发送的数据rn //[3].发送数据包rn this.Write(values.ToArray());rn //[4].防止连续读写引起前台UI线程阻塞rn Application.DoEvents();rn //[5].读取Response: 写完后会<em>返回</em>12个byte的结果rn byte[] responseHeader = this.Read(12);rnrn string str = System.Text.Encoding.UTF8.GetString(responseHeader);rn rn /// rn /// 连接主机rn /// rn private void Connect()rn rn socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);rn socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout, TimeOut);rnrn IPEndPoint ip = new IPEndPoint(IPAddress.Parse(IP), Port);rn socket.Connect(ip);rn rnrn //事务标识加1rn protected byte NextDataIndex()rn rn return ++this.dataIndex;rn rnrn public void Write(byte[] data)rn rn this.Log("Send:", data);rn this.socket.Send(data);rn rnrn public byte[] Read(int length)rn rn byte[] data = new byte[length];rn this.socket.Receive(data);rn this.Log("Receive:", data);rn return data;rn rnrn private void Log(string type, byte[] data)rn rn StringBuilder logText = new StringBuilder(type);rn foreach (byte item in data)rn rn logText.Append(item.ToString() + " ");rn rnrn this.textBox2.AppendText(logText + Environment.NewLine);rn this.textBox2.Select(this.textBox1.TextLength, 0);rn this.textBox2.ScrollToCaret();rnrn this.textBox2.AppendText(System.Text.Encoding.UTF8.GetString(data));rn rn rn
nginx+php-fastcgi访问php返回400
服务器:nginx + php-fastcgirnrn现象:rn chmod -R 777 /www/rn nginx user=nobody运行,访问/www/index.php提示404 Not Found。rn 把user改成root之后再访问/www/index.php正常,能够打印phpinfo。rnrn问题:rn 为什么以nobody身份运行nginx会报404 Not Found,不是应该报403吗?没有权限怎么连文件都找不到了?rn 怎么样让nginx worker进程在nobody身份运行下,能正常访问phprn rn rnnginx配置文件:rn[<em>code</em>=C/C++]rnuser nobody nogroup;rnworker_processes 1;rnrnevents rn worker_connections 1024;rnrnrnhttp rn include mime.types;rn default_type application/octet-stream;rnrn sendfile on;rnrn keepalive_timeout 65;rnrn server rn listen 80;rn server_name localhost;rnrn location / rn root /www/;rn index index.html index.htm index.php;rn rnrn error_page 500 502 503 504 /50x.html;rn location = /50x.html rn root /www/;rn rnrn location ~ \.php$ rn root /www/;rn fastcgi_pass 127.0.0.1:9000;rn fastcgi_index index.php;rn fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;rn include fastcgi_params;rn rn rnrn[/<em>code</em>]rn
the status code returned from the server was: 12029
rnSys.WebForms.PageRequestManagerServerErrorException: An Unknow error occurred while processing the request on the server. the <em>status</em> <em>code</em> returned from the server was: 12029rnrn[img=http://hi.csdn.net/attachment/201101/11/56931_12947386558hpH.jpg][/img]rnrn[img=http://hi.csdn.net/attachment/201008/6/2539454_1281104750VdqT.jpg][/img][url=http://blog.csdn.net/boringame/category/720069.aspx]会自动答题的论坛辅助工具:《Csdn收音机》![/url]
Http 状态码(status code)常用总结
本来计划写一篇浏览器错误码使用的详细总结,近来想了想,第一这不是很深入的知识点、主要还是一种规定;第二对常用的几种的一个使用场景已经有所了解了,所以今天就写一个简单的汇总,并黏贴常用几个错误码的介绍在这里备查。 首先,还是说一下200和304,这两个都是关于读取缓存内容,无需服务端<em>返回</em>的意思。但是两者的区别在于200的cached状态是直接取缓存,304则是请求发送到后端,后端提示可以重定向到缓存...
学习HTTP Status Code的一些总结
针对web开发遇到的各种错误进行解释!了解了这些代码所对应的意义,以及出现这些代码所意味的服务器或客户端的一些问题,以及常见问题的解决方法,学习工作起来效率会提高很多。
HTTP status code 403 : Forbidden 这是啥意思?
rn谁来告诉我?rnrn
the status code returned from the server was 500
如果页面收到这样的错误,the <em>status</em> <em>code</em> returned from the server was 500 会弹出一个框,我想不让它显示在页面上,也就是不弹出框, 浏览器直接捕获这样的错误,然后刷新页面,该如何处理呢
the status code returned from the server was:404
在运行 aspx 是出现这样的错误是怎么回事.rnSys.WebForms.PageRequestManagerServerErrorException:An unknown error occurred while processing the request on the server. rnthe <em>status</em> <em>code</em> returned from the server was:404 不知道为什么? 请大家帮我看看rn
如何读取TWebBrowser状态(Status Code)
我想要TWebBrowser Status Code.(example: Status Code=200 or Status Code=401 ...)
返回sql code的问题??
SQL <em>code</em>:+1403rnSQL <em>code</em>:-2049rnSQL <em>code</em>:-60rn分别表示什么?rn
jqgrid遇到这个问题error Status: 'Bad Request'. Error code: 400
添加记录rnerror Status: 'Bad Request'. Error <em>code</em>: <em>400</em>rnrn和修改记录都报这个错,请问哪位大侠熟悉jqgrid,帮忙看看啊rnrnindex.js是这样的:rnrn[<em>code</em>=javascript]$(function() rnrn $.extend($.jgrid.defaults, rn datatype: 'json',rn jsonReader : rn repeatitems:false,rn total: function(result) rn //Total number of pagesrn return Math.ceil(result.total / result.max);rn ,rn records: function(result) rn //Total number of recordsrn return result.total;rn rn ,rn prmNames: rows: 'max', search: null,rn height: 'auto',rn viewrecords: true,rn rowList: [10, 20, 50, 100],rn altRows: true,rn loadError: function(xhr, <em>status</em>, error) rn alert(error);rn rn );rnrn $.extend($.jgrid.edit, rn closeAfterEdit: true,rn closeAfterAdd: true,rn ajaxEditOptions: contentType: "application/json" ,rn mtype: 'PUT',rn serializeEditData: function(data) rn delete data.oper;rn return JSON.stringify(data);rn rn );rn $.extend($.jgrid.del, rn mtype: 'DELETE',rn serializeDelData: function() rn return "";rn rn );rnrn var editOptions = rn onclickSubmit: function(params, postdata) rn params.url = URL + '/' + postdata.id;rn rn ;rn var addOptions = mtype: "POST";rn var delOptions = rn onclickSubmit: function(params, postdata) rn params.url = URL + '/' + postdata;rn rn ;rnrn var URL = 'material';rn var options = rn url: URL,rn editurl: URL,rn colModel:[rn rn name:'id', label: '物品ID', rn formatter:'integer',rn width: 80,rn editable: true,rn editoptions: disabled: false, size:16rn ,rn rn name:'categoryCode', label: '类别编号',rn width: 100,rn editable: true,rn editrules: required: truern ,rn rn name:'materialCode',rn label: '物品编号',rn width: 150,rn editable: true,rn editrules: required: true,rn editoptions: disabled: false, size:32rn ,rn rn name:'categoryName',rn label: '物品名称',rn width: 200,rn editable: true,rn editrules: required: truern ,rn rn name:'color',rn label: '物品颜色',rn width: 60,rn editable: true,rn editrules: required: truern ,rn rn name:'quantity',rn label: '数量',rn formatter:'integer',rn width: 30,rn align: 'center',rn editable: true,rn editrules: required: true, integer: true,rn editoptions: size:5, maxlength: 10rn ,rn rn name:'usable',rn label: '是否可用',rn formatter: 'checkbox',rn width: 50,rn align: 'center',rn editable: true,rn edittype: 'checkbox',rn editoptions: value:"true:false"rn ,rn rn name:'Comments',rn label: '备注',rn width: 200,rn hidden: true,rn editable: true,rn edittype: 'textarea',rn editrules: edithidden:truern rn ],rn caption: "Material List",rn pager : '#pager',rn height: 'auto',rn ondblClickRow: function(id) rn jQuery(this).jqGrid('editGridRow', id, editOptions);rn rn ;rnrn $("#grid")rn .jqGrid(options)rn .navGrid('#pager',rn , //optionsrn editOptions,rn addOptions,rn delOptions,rn // search optionsrn );rnrn);[/<em>code</em>]rnrnrnMaterialControler:rnrn[<em>code</em>=java]package com.zdy.mms.rest.material;rnrnimport static java.util.Collections.singletonList;rnimport static org.springframework.web.bind.annotation.RequestMethod.DELETE;rnimport static org.springframework.web.bind.annotation.RequestMethod.GET;rnimport static org.springframework.web.bind.annotation.RequestMethod.POST;rnimport static org.springframework.web.bind.annotation.RequestMethod.PUT;rnrnimport java.net.URI;rnimport java.util.ArrayList;rnimport java.util.List;rnimport java.util.Map;rnimport java.util.concurrent.ConcurrentSkipListMap;rnimport java.util.concurrent.atomic.AtomicInteger;rnrnimport javax.annotation.PostConstruct;rnimport javax.servlet.http.HttpServletRequest;rnrnimport org.springframework.beans.factory.annotation.Autowired;rnimport org.springframework.http.HttpHeaders;rnimport org.springframework.http.HttpStatus;rnimport org.springframework.http.ResponseEntity;rnimport org.springframework.stereotype.Controller;rnimport org.springframework.web.bind.annotation.PathVariable;rnimport org.springframework.web.bind.annotation.RequestBody;rnimport org.springframework.web.bind.annotation.RequestMapping;rnimport org.springframework.web.bind.annotation.RequestParam;rnimport org.springframework.web.bind.annotation.ResponseBody;rnimport org.springframework.web.bind.annotation.ResponseStatus;rnimport org.springframework.web.util.UriTemplate;rnrnimport com.zdy.mms.dao.MaterialDao;rnimport com.zdy.mms.rest.Page;rnrn@Controllerrn@RequestMapping(value = "/material")rnpublic class MaterialController rn @Autowiredrn private MaterialDao materialDao;rnrn private final AtomicInteger curId = new AtomicInteger();rn private final Map materials = new ConcurrentSkipListMap();rnrn @PostConstructrn public void initMaterialDatabase() rn curId.getAndAdd(100);rn //Load the Materials from DB rn List allMaterialList = materialDao.findAll();rn for(Material m: allMaterialList)rn materials.put(m.getId(),m);rn rn /*rn save(new Material("03030101", "03030101-01", "大型推土机", 2, true,Color.Red,""));rn save(new Material("03030101", "03030101-02", "大型推土机", 1, true,Color.Blue,""));rn save(new Material("010101", "010101-1~100", "签字笔", 2, true,Color.Black,""));rn */rn rnrn @RequestMapping(value = "/id", method = GET)rn publicrn @ResponseBodyrn Material read(@PathVariable("id") int id) rn return materials.get(id);rn rnrn @RequestMapping(method = GET)rn publicrn @ResponseBodyrn Page listMaterials(rn @RequestParam(value = "page", required = false, defaultValue = "1") int page,rn @RequestParam(value = "max", required = false, defaultValue = "20") int max) rn final ArrayList materialsList = new ArrayList(materials.values());rn final int startIdx = (page - 1) * max;rn final int endIdx = Math.min(startIdx + max, materials.size());rn return new Page(materialsList.subList(startIdx, endIdx), page, max, materials.size());rn rnrn @RequestMapping(value = "/id", method = PUT)rn @ResponseStatus(HttpStatus.NO_CONTENT)rn public void updateMaterial(@PathVariable("id") int id, @RequestBody Material material) rn if (materials.containsKey(id)) rn material.setId(id);rn materials.put(id, material);rn rn rnrn @RequestMapping(method = POST)rn public ResponseEntity createMaterial(HttpServletRequest request, @RequestBody Material material) rn final int id = material.getId();//save(material);rnrn URI uri = new UriTemplate("requestUrl/username").expand(request.getRequestURL().toString(), id); rn rn final HttpHeaders headers = new HttpHeaders();rn headers.put("Location", singletonList(uri.toASCIIString()));rn return new ResponseEntity(headers, HttpStatus.CREATED);rn rnrn private Integer save(Material material) rn final int id = curId.incrementAndGet();rn material.setId(id);rn materials.put(id, material);rn return id;rn rnrn @RequestMapping(value = "/id", method = DELETE)rn @ResponseStatus(HttpStatus.NO_CONTENT)rn public void deleteMaterial(@PathVariable("id") int id) rn materials.remove(id);rn rnrnrnrnrnMaterial:rnpackage com.zdy.mms.rest.material;rnrnimport javax.xml.bind.annotation.XmlRootElement;rnrn@XmlRootElementrnpublic class Material implements Comparable rn private Integer id;rn private String categoryCode;rn private String materialCode;rn private String categoryName;rn private int quantity;rn private boolean usable;rn private String color;rn private String comments;rnrn public Material() rn rnrn @Overridern public int compareTo(Material o) rn return id > o.id? 1 : id < o.id? -1 : 0;rn rnrn public Material(int id,String categoryCode, String materialCode, String categoryName,rn int quantity, boolean usable, String color, String comments) rn this.id = id;rn this.categoryCode = categoryCode;rn this.materialCode = materialCode;rn this.categoryName = categoryName;rn this.quantity = quantity;rn this.usable = usable;rn this.color = color;rn this.comments = comments;rn rn rn public Integer getId() rn return id;rn rnrn public void setId(Integer id) rn this.id = id;rn rnrn public String getCategoryCode() rn return categoryCode;rn rnrn public void setCategoryCode(String categoryCode) rn this.categoryCode = categoryCode;rn rnrn public String getMaterialCode() rn return materialCode;rn rnrn public void setMaterialCode(String materialCode) rn this.materialCode = materialCode;rn rnrn public String getCategoryName() rn return categoryName;rn rnrn public void setCategoryName(String categoryName) rn this.categoryName = categoryName;rn rnrn public int getQuantity() rn return quantity;rn rnrn public void setQuantity(int quantity) rn this.quantity = quantity;rn rnrn public boolean isUsable() rn return usable;rn rnrn public void setUsable(boolean usable) rn this.usable = usable;rn rnrn public String getColor() rn return color;rn rnrn public void setColor(String color) rn this.color = color;rn rnrn public String getComments() rn return comments;rn rnrn public void setComments(String comments) rn this.comments = comments;rn rn[/<em>code</em>]
AFN Post请求,报错400code:-1011)
请求格式不对,服务器要json格式的请求,所以要加下面的代码: mgr.requestSerializer = [AFJSONRequestSerializer serializer];
org.apache.thrift.transport.TTransportException:http response code 400如何解决
在数据上传时执行一段时间后,出现org.apache.thrift.transport.TTransportException:http response <em>code</em> <em>400</em>,数据停止上传,再重新执行上传数据的方法,又是执行一段时间报同样的错误,出现这种错误的原因是什么,怎么解决。
Server returned HTTP response code: 400 for URL
代码如下 rnString s = HttpHelper.doGet(articleVO.getImg()+"?x-oss-process=image/info");rn用阿里云的info获取图片的信息 路径没有问题 可以打开 但是却报错rnjava.io.IOException: Server returned HTTP response <em>code</em>: <em>400</em> for URL: rn不知道是什么原因 进行去除空格之后还是出现这种一样报异常 请大佬帮忙看一下是什么原因
IWEB_GetResponse的运用请高手指教
IWEB_GetResponse(PWebInfo->pIWeb,(PWebInfo->pIWeb,&PWebInfo->pIWebResp,&PWebInfo->cbWeb,pUrl,rnWEBOPT_END));rn这个PWebInfo->pIWebResp计数释放时需要怎么去处理?在释放时看到这个时候内存地址打印出来是0x0000000而计数没有release完。是否会造成内存泄漏,机器死机重启?
AJAX返回status的值经常是-1
代码如下,不知道各位有没有遇见过这种问题。代码不是运行在IE里,是widget。开发文档里写的支持javascript,但是用ajax请求数据时,有时候就会出xhr.<em>status</em> = -1 的情况,其他时候正常<em>返回</em><em>status</em> =200 。请各位大侠帮忙解答rn[<em>code</em>=JScript]rnfunction getNews(id,url,type,sort)rnrn var xhr;rn //call the right constructor for the browser being usedrn if (window.ActiveXObject)rn xhr = new ActiveXObject("Microsoft.XMLHTTP");rn else if (window.XMLHttpRequest)rn xhr = new XMLHttpRequest();rn elsern alert("AJAX request not supported");rn rn //prepare the xmlhttprequest objectrn xhr.open("GET", url, true);rn xhr.setRequestHeader("Cache-Control", "no-cache");rn xhr.setRequestHeader("Pragma", "no-cache");rn xhr.onreadystatechange = function() rn if (xhr.readyState == 4)rn rn if (xhr.<em>status</em> == 200)rn rn if (xhr.responseText != null)rn rn //process sina newsrn processNews(xhr.responseXML, id,type,sort,url);rn rn elsern rn alert("Failed to receive RSS file from the server - file not found.");rn return false;rn rn rn elsern rn alert("Error <em>code</em> " + xhr.<em>status</em> + " received: " + xhr.<em>status</em>Text);rn rn rn rn //send the requestrn xhr.send(null);rnrn[/<em>code</em>]rn
AJAX 返回status=0的诡异问题!!!!!!!!!!!
AJAX <em>返回</em><em>status</em>=0 可是我已经和服务器交互了啊 在action的后台也会输出xml.为什么jsp接受不到呢 各位大虾帮帮忙啊rnjsp代码如下:rn[<em>code</em>=Java]rnrnrnrnrn rn rn rn rn rn rn rn rn rnrn rn rn rn rn rn rn 请输入要充值员工的email: rn rn rn rn rn rn rn rn rnrnrn[/<em>code</em>]rn下面是action:[<em>code</em>=Java]public String admin_rechargeListMessage()//<em>status</em> 1:查找成功 2:没有登陆3:输入不完整4:用户不存在rnSystem.out.print("s");rn String <em>status</em> ="0";rn ActionContext actionContext = ActionContext.getContext();rn Map session = actionContext.getSession();rn boolean ok = true;rn StringBuffer xml;rn Yonghu yonghuByYonghuManager=new Yonghu();rn if ((String) session.get("admin") == null) rn ok = false;rn <em>status</em> = "2";rn rn rn if (ok==true) rn if (yonghu.getYEmail().equals("") || yonghu.getYEmail() == null)rn rn <em>status</em> = "3";rn rn rn else rn if (yonghuManager.getYonghu(yonghu.getYEmail())== null) rn rn <em>status</em> ="4";rn else rn yonghuByYonghuManager=yonghuManager.getYonghu(yonghu.getYEmail());rn <em>status</em> = "1";rn rn rnrn rn rn xml = new StringBuffer("");rn xml.append(<em>status</em>);rn xml.append("");rn xml.append("");rn xml.append((String)yonghuByYonghuManager.getYName());rn xml.append("");rn xml.append("");rn xml.append((String)yonghuByYonghuManager.getYEmail());rn xml.append("");rn xml.append("");rn xml.append((String)yonghuByYonghuManager.getYDepartment());rn xml.append("");rn xml.append("");rn rn try rn HttpServletResponse response = ServletActionContext.getResponse();rn response.setContentType("text/xml");rn response.getWriter().println(xml.toString());rn catch (IOException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn [color=#FF0000]Sysytem.out.print(xml.toString());[/color]//此处在后台可以输出rn return null;rn [/<em>code</em>]
android BLE onServicesDiscovered返回status=129
最近在做ble的项目,发现service的时候,onServicesDiscovered方法<em>返回</em>的<em>status</em>值为129,有的手机<em>status</em>是0,有的一会是0一会是129,遇到这个问题的朋友有没有已经解决的
Axios在返回status是多少时,调用then方法
这种困惑了很久,网上也没有找到答案,忍不住下载了源码,分析了一下,终于在defaults.js文件中找到了答案 validateStatus: function validateStatus(<em>status</em>) { return <em>status</em> &amp;gt;= 200 &amp;amp;&amp;amp; <em>status</em> &amp;lt; 300; } 也就是说在我们没有设置adapter的validateStatus方...
高分求助:调用webservice出现 “HTTP status 400: Bad Request”
本人作的一个asp.net程序,调用自己的webservice; 在本机正常;迁移到服务器上后,调用webservice时发生异常:rnrn//---------------------------------------------------------------------rnServer Error in '/App' Application.rn--------------------------------------------------------------------------------rnrnThe request failed with HTTP <em>status</em> <em>400</em>: Bad Request. rnDescription: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the <em>code</em>. rnrnException Details: System.Net.WebException: The request failed with HTTP <em>status</em> <em>400</em>: Bad Request.rnrnSource Error: rnrnAn unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. rnrnStack Trace: rnrnrn[WebException: The request failed with HTTP <em>status</em> <em>400</em>: Bad Request.]rn System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +1358rn System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +205rn EduService.TCYWEDUService.CheckValidUser(Int32 pUserType, String pUserName, String pPassword) +95rn _Default.Login1_Authenticate(Object sender, AuthenticateEventArgs e) +118rn System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +105rn System.Web.UI.WebControls.Login.AttemptLogin() +106rn System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +101rn System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35rn System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115rn System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +165rn System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7rn System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11rn System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33rn System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5609rnrn rnrnrn--------------------------------------------------------------------------------rnVersion Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42 rnrnrnrn注:因服务器上有一另外一网站独占80端口,所以我的程序使用8080端口,但在我本机也是设置8080端口的,没有问题。rnrngoogle搜了很多结果出来,可能是受台湾地震影响,就是没一个页面能访问。百度没有,csdn全文检索也没有满意的答案。劳烦有解决方案的兄台赐教!rn
SQL 调用webservices 返回状态status 404
公司有个sql调用webservices,以前是用get 方式没有问题,但是get方式对参数有长度限制,后面改成post,没有问题,但是前几天升级了SQL后,发现,post方式开始报错,<em>返回</em><em>status</em>=404.但是换成get方式又没有问题。有没有大佬能给出点建议参考下。rnrn EXEC @hResult = sp_OAMethod @Object, 'open', NULL, 'POST',@ServiceUrl,'false' rn IF @hResult<>0rn BEGINrn SELECT @Result = 0, @ReturnMsg ='调用web service失败,打开失败'rn RAISERROR(@ReturnMsg , 12, 1)rn GOTO Destroyrn ENDrnrn ......rnrn exec @hResult = sp_OAGetProperty @Object, 'Status', @<em>status</em> out --这里<em>返回</em>的状态就不对了,为404rn IF @hResult <> 0 rn BEGINrn EXEC sp_OAGetErrorInfo @Object,@Source OUT,@ReturnMsg OUT;rn RAISERROR('readyState 0x%x, %s, %s',16,1, @hResult, @Source, @ReturnMsg)rn GOTO Destroyrn END rn IF @<em>status</em> <> 200 rn BEGIN rn print @ServiceUrl; rn PRINT @<em>status</em>;rn RAISERROR('Open http <em>status</em> bad', 16,1) rn GOTO Destroyrn END rnrnrn rnrnrnrn
status 400: Bad Request"">调用webservice出现"The request failed with HTTP status 400: Bad Request"
在本地调试正常,迁移到服务器上后,调用webservice时发生异常://Server Error in '/web' ApplicationrnThe request failed with HTTP <em>status</em> <em>400</em>: Bad Request. rnDescription: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the <em>code</em>. rnrnException Details: System.Net.WebException: The request failed with HTTP <em>status</em> <em>400</em>: Bad Request.rnrnSource Error: rnrnAn unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. rn...
紧急求助:The request failed with HTTP status 400: Bad Request.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the <em>code</em>. rnrnException Details: System.Net.WebException: The request failed with HTTP <em>status</em> <em>400</em>: Bad Request.rnrnSource Error: rnrnrnLine 1833: [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.zii.com/ReportGeneralInquiry", RequestNamespace="http://www.zii.com", ResponseNamespace="http://www.zii.com", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]rnLine 1834: public bool ReportGeneralInquiry(string emailId, string firstName, string lastName, string userName, string issueDescs, string issueTitle, out string CaseNostr, out string customerCaseLink) rnLine 1835: [color=#FF0000]object[] results = this.Invoke("ReportGeneralInquiry", new object[] [/color]Line 1836: emailId,rnLine 1837: firstName,rn rnrnSource File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\26a84a27\ccc009c6\App_WebReferences.iux74zmt.0.cs Line: 1835 rnrnStack Trace: rnrnrn[WebException: The request failed with HTTP <em>status</em> <em>400</em>: Bad Request.]rn System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +533252rn System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +204rn Support.SupportService.ReportGeneralInquiry(String emailId, String firstName, String lastName, String userName, String issueDescs, String issueTitle, String& CaseNostr, String& customerCaseLink) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\26a84a27\ccc009c6\App_WebReferences.iux74zmt.0.cs:1835rn Support_support.imgSubmit_Click(Object sender, ImageClickEventArgs e) in e:\websites\ziicn\Support\support.aspx.cs:61rn System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +105rn System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +115rn System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7rn System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11rn System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33rn System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102rnrn rn应用webservice一直出现上述错误,不知是何原因?希望大家帮帮我
微信登录授权返回code乱码
在做移动端微信登录的时候,有的人遇到微信登录授权之后获得的<em>code</em>是这样的" ᘀ游客61076345ȀȀȀ",而正确的<em>code</em>应该是类似"001mvv6k00y8In1SbA6k00II6k0mvv6E"这样的,所以去验证的时候回<em>返回</em>错误码<em>400</em>29,invalid <em>code</em>rn为什么会有出现类似如 ᘀ游客61076345ȀȀȀ这种<em>code</em>呢?rn各位大侠有遇到过吗?
网站返回411 code解决办法
问题:今天fuck 12306的查询订单接口时,一直提示接口<em>返回</em>错误,查看接口<em>返回</em>码是411 查证411<em>返回</em>码代表什么 服务器拒绝在没有定义 Content-Length 头的情况下接受请求。在添加了表明请求消息体长度的有效 Content-Length 头之后,客户端可以再次提交该请求。 解决办法 post 登录headers加上下面的头即可解决 {&quot;Content-Length&quot;:...
返回前端Json(code,msg)
前提:关于jackson的介绍参看:https://blog.csdn.net/zmx729618/article/details/52161069先在maven中引入jackson的核心jar&amp;lt;!--com.fasterxml.jackson--&amp;gt; &amp;lt;dependency&amp;gt; &amp;lt;groupId&amp;gt;com.fasterxml.jackson.core&amp;lt;/g...
测试springmvc表单提交新增数据,服务器报400错误-----HTTP Status 400
用postman测试一个新增数据的控制器方法时,报了<em>400</em>错误 经查,是请求无效的意思 一般可能出现在有Date格式的数据表中 我的模型类有个Date类型的数据,如果要正常传入,可以添加以下代码在Date格式数据上方,如图所示 @DateTimeFormat(pattern=”yyyy-MM-dd”) @JsonFormat(timezone = “GMT+8”,...
IWEB_GetResponse的运用问题,请高手指教
extern void WebDemo_GetPage(webinfo *PWebInfo,char *pUrl)rnrn rn IWEB_GetResponse(PWebInfo->pIWeb,(PWebInfo->pIWeb,&PWebInfo->pIWebResp,&PWebInfo->cbWeb,pUrl,rn WEBOPT_END));rnrnrnextern void WebDemo_cbWeb(webinfo *PWebInfo)rnrn PWebInfo->pRespInfo = IWEBRESP_GetInfo(PWebInfo->pIWebResp);rn if(WEB_ERROR_SUCCEEDED(PWebInfo->pRespInfo->nCode))rn rn long pDataLength = (long)(PWebInfo->pRespInfo->lContentLength);rn PWebInfo->pData = (char *)MALLOC(pDataLength);rn ISOURCE_Read(PWebInfo->pRespInfo->pisMessage, (char *)PWebInfo->pData, pDataLength);rn (PWebInfo->m_pResedData)(NULL,PWebInfo->pData,pDataLength);rn rn ......rnrnrnrn我想从服务器上读取数据,现在的问题是能进入回调函数WebDemo_cbWeb,但是PWebInfo->pRespInfo->nCode的值不正确,有<em>400</em>,401,404,我不知道问题出在IWEB_GetResponse的哪个参数不正确还是我少配置了什么参数,还是..... ,总之有点迷糊了。rn有时也能正确的取得PWebInfo->pRespInfo->nCode的值200.rn如果哪位高手知道问题所在,麻烦点拔一下,不胜感激!
记住密码页面返回时出错400
问题:在做登录界面时,如果点击“记住密码”进入下一个页面并后退到登录界面,再点击“登录”并且不点击“记住密码”时, 服务器就会报<em>400</em>错误,原因是第二次登录时由于没对“记住密码”做任何操作,所以isAuto<em>返回</em>的值是null,而int型不能接收null值,就会报错。 “解决办法:把接收变量类型改成integer型,它可以接收null值。 建议:以后接收整型数据时没有特殊情况尽量都用intege
ShowWindow错误,GetLastError返回400,怎么回事?
ERROR_THREAD_MODE_ALREADY_BACKGROUNDrn<em>400</em> (0x190) The thread is already in background processing mode.rnrn怎么回有这样的错误? 我写了一个很简单的Win32程序,只是想显示一个最简单的窗口,如下代码:rnrn[<em>code</em>=C/C++]rn#includern#includernconst char className[]="mywndclass";rnLRESULT __stdcall myproc(HWND hWnd,UINT uMsg,WPARAM wp,LPARAM lp)rn return 0L;rnrnint __stdcall WinMain(rn HINSTANCE hInst,rn HINSTANCE hPrev,rn LPSTR lpCmdLine,rn int nCmdShowrn)rn WNDCLASSEX wnd;rn ZeroMemory(&wnd,sizeof(wnd));rn wnd.cbSize=sizeof(wnd);rn wnd.lpszClassName=className;rn wnd.lpszMenuName=NULL;rn wnd.hInstance=hInst;rn wnd.lpfnWndProc=myproc;rn wnd.hbrBackground=(HBRUSH)MAKEINTRESOURCE(GRAY_BRUSH);rn HWND hWnd=CreateWindowEx(0,className,"窗口名称",0,0,0,300,200,NULL,NULL,hInst,0);rn if(INVALID_HANDLE_VALUE==hWnd)rn MessageBox(NULL,"Error!","CreateWindowEx失败\n",MB_OK);rn return 1;rn rn if(!ShowWindow(hWnd,SW_SHOW))rn char dip[200];rn sprintf(dip,"ShowWindow失败:%d\n",GetLastError());rn MessageBox(NULL,"Error!",dip,MB_OK);rn return 1;rn rn return 0;rnrn[/<em>code</em>]
mvn deploy时返回400解决方法.md
使用mvn deploy命令,将打包后的jar包上传到私服时,出现了下面的问题: Return <em>code</em> is: <em>400</em>, ReasonPhrase: Bad Request. -&amp;gt; [Help 1] 一般通用有3个导致出现上面问题的原因: 1.pom.xml中仓库id配置不对 &amp;lt;distributionManagement&amp;gt; &amp;lt;repository&amp;gt;...
记一次HTTP返回400的错误
今天在一次访问后台中,服务器总是<em>返回</em><em>400</em>,通过wireshark抓包显示如下:POST/shsys-web/cc/module/v3/sub/sync?seq=37670&amp;amp;id=0077a33dbbd6a5839713&amp;amp;sn=15414b2300793583&amp;amp;d=aqeGAnlrIzg=HTTP/1.1 Host: 103.255.94.178:8080 Conten...
httpclient模拟登录post请求,总是返回400
[img=https://img-bbs.csdn.net/upload/201803/06/1520323246_263687.png][/img]rn[img=https://img-bbs.csdn.net/upload/201803/06/1520323261_64287.png][/img]rnrn[color=#FF0000]贴代码[/color]:rn String loginurl="https://v4.passport.sohu.com/i/login/101305"rnString userid=url;rnString password=md5Util.Pd(passwords);rnSystem.out.println(password);rnString appid="101305";rnString callback="";rn//登录所需参数rnList list=new ArrayList();rnlist.add(new BasicNameValuePair("userid", userid));rnlist.add(new BasicNameValuePair("password", password));rnlist.add(new BasicNameValuePair("appid", appid));rn//list.add(new BasicNameValuePair("callback", callback));rn//发送请求rnHttpPost httpPost=new HttpPost(loginurl);rnUrlEn<em>code</em>dFormEntity uefEntity=new UrlEn<em>code</em>dFormEntity(list, "UTF-8");rnhttpPost.setEntity(uefEntity);rn//设置头部参数rnhttpPost.setHeader("Content-Type","text/html;charset=UTF-8");rnhttpPost.setHeader("User-Agent", "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0");rn//接收相应rnCloseableHttpResponse response=httpclient.execute(httpPost, context);rnSystem.out.println("状态码"+response.getStatusLine().getStatusCode());rnrnHttpEntity Entity=response.getEntity();rnString result=EntityUtils.toString(Entity,"utf-8");rnSystem.out.println("登录结果"+result);rnrn[color=#FF0000]运行结果[/color]rn 登录结果"body":"","message":"Bad Request","<em>status</em>":<em>400</em>rn
axios发送post请求返回400状态码
今天在用 axios 发送一个跨域的post请求时,遇到了一个坑:Uncaught (in promise) Error: Request failed with <em>status</em> <em>code</em> <em>400</em>。 前台代码如下: axios({ method: &quot;post&quot;, url: &quot;http://localhost:8080/employee/testpost&quot;, data: {...
ssm 返回的json数据出现400 错误
&amp;#13; 当用ssm 框架 取@ResponseBoby <em>返回</em>json 数据时出现<em>400</em>错误 一般<em>400</em>:表示数据类型错误 问题:有的数据不出现<em>400</em>错误 有的数据出现<em>400</em>错误 发现:检查发现代码没有存在问题 解决:数据库查询的一些值为null ,在系统将对象转换为json 数据时,出现异常 1.数据库设计避免出现null ,使用默认值 2 在xml 的查询语句要确保不会...
返回据现在400天的时间段
select * from datevideo where timediff(now(),date) &lt; <em>400</em> select * from times where times&gt;'2011-02-01 15:00:00' and times&lt; '2011-02-01 19:00:00'
发送HTTP请求,返回400错误
我是用Eclipse开发,想获得Web的信息,用户名和密码用base64加密,表头代码如下:rnrnrn rn String auth="admin:password";rn auth = en<em>code</em>(auth.getBytes());rn rn rn sb.append("GET"+"/index/cgi/index.cgi"+"?username=admin&password=password&submit=submit"+"HTTP/1.1\r\n");rn sb.append("User-Agent:Mozilla/4.0(compatible;MSIE 6.0;Windows NT 5.0)\r\n");rn sb.append("Accept:*/*\r\n");rn sb.append("Accept-Language:zh-cn\r\n");rn sb.append("Authorization: Basic "+auth+"\r\n");rn sb.append("Host:10.8.21.110:6295\r\n");rn sb.append("Connection:Keep-Alive\r\n\r\n");rnrnrnrn现在连接后<em>返回</em><em>400</em>错误,提示请求无效。。各位大侠知道如何解决吗?rn我是用Eclipse直接发送请求的,会是User-Agent的问题吗? 或者需要安装别的什么插件吗?
http get方法返回400 Bad Request原因?
直接在ie上输http://192.168.106.154:8081/cgi-bin/channels.cgi?action=get能出来我要的界面,rn在vc程序中向socket连接发送"GET http://192.168.106.154:8081/cgi-bin/channels.cgi HTTP/1.0\r\nAccept:text/html\r\n\r\n"却<em>返回</em>下面的:rnHTTP/1.0 <em>400</em> Bad RequestrnServer: mini_httpd..Cache-Control: no-cache,no-storernContent-Type: text/html; charset=%srnConnection:closernrn. <em>400</em> Bad Request.. <em>400</em> Bad Request.Bad filenamern这是什么原因?
SpringMVC字段验证返回400错误码
错误信息HTTP Status <em>400</em> – Bad RequestType Status ReportDescription The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax,
通过代理连接服务器,返回错误代码400
我发送级代理服务器的数据如下:rn[<em>code</em>=C/C++]rnCONNECT www.baidu.com:80 HTTP/1.1 Accept: */* Content-Type: text/html Proxy-Connection: Keep-Alive Content-length: 0 rn[/<em>code</em>]rnrn请问是什么原因?
Ajax壮态码返回400
rnrn请大家指点一下rnweb.xmlrnrnrn Ajaxrn com.ou.util.Ajaxrn rnrn Ajaxrn /ajaxrn
AJAX请求返回HTTP 400 错误
AJAX请求<em>返回</em>HTTP <em>400</em> 错误 - 请求无效 (Bad request),但是直接访问请求地址可以访问到数据 在ajax请求后台数据时有时会报HTTP<em>400</em>错误-请求无效(Badrequest);出现这个请求无效报错说明请求没有进入到后台服务里; 原因:      1)前端提交数据的字段名称或者是字段类型和后台的实体类不一致,导致无法封装;      2)前端提交的到后台的数据应该是jso...
spring表单标签提交返回400错误问题
spring4.3.8spring表单标签个人觉得非常好用,一个非常明显的特点就是和po、vo或dto对应,很好的整合了校验框架和视图映射,对象图映射等。在使用的时候有一种错误并不是很明显能够看出来,那就是提交表单的时候得到<em>400</em>错误,一种让人懵逼的错误,由于遇到多了,这里作一个汇总。1、如果标签的path对应的是一个对象图属性,那么有可能存在类型不匹配导致<em>400</em>,非对象图一般不会发生,因为都是字...
使用 springMVC 请求Action 返回400编码
java 使用 springMVC 请求Action <em>返回</em><em>400</em>编码  环境:j2ee web网站,使用spring MVC框架,页面时间选择控件使用的是 easyui-datebox    问题描述: 在请求指定 action方法时,方法参数为自定义类型 public class Person { private Integer id; private String name; p
为什么HttpClient请求返回400,URL请求返回302正常?
今天在做http请求的时候,发现了一个很别扭的地方。rn我使用android在请求广告资源的时候,<em>返回</em>给我<em>400</em>(),我以为是服务的问题。rn没太在意,可以后来用浏览器打开这个地址,发现浏览器<em>返回</em>的<em>code</em>是302,然后再跳一次跳转就可以跳转到200正常的界面。rn所以很纳闷。rn后来用URL进行请求,发现也能<em>返回</em>正常的<em>code</em>:200rn很晕。rnURL请求:rnHttpURLConnection openConnection = (HttpURLConnection) u.openConnection(); rnint responseCode = openConnection.getResponseCode();rnInputStream inputStream = openConnection.getInputStream();rnSystem.out.println(responseCode);rnrnClient请求:rnHttpClient client=new DefaultHttpClient();rnHttpGet get = new HttpGet(url);rnHttpResponse response = client.execute(get);rnint <em>status</em>Code = response.getStatusLine().getStatusCode();rnrnrnrnurl地址:rnhttp://mobads.baidu.com/ad.html?url=http%3A%2F%2Fm.baidu.com%2Fcpro.php%3Fa0fK000cFDtp14ipxciFcucWgFoHy2H9iL-QuuIcNAkYIMRiaPQiWnmR6W2aNPD15t3bHYIBjLSFbvjfpThNBsKZLbZAU51-HXSkBpuqvKBXOMaqOkbYINsLI1jq.Db_ipx2roRhF596OlZextW6H7sEyFBOg_vTyyxZ-9k1QjPakblN0.IgF_5y9YIZ0lQzqLILT8mh7GuZR8mvqVQsKYUHYs0Zwd5H00IvsqP6KWUMw85yFhrj61myDLgvPsT6KYI1Yz0A7bmvk9TLnqn0KzT1Ys0APYUHdBmy-bIRPdTLw2Tvq80A49IZRqr0KGIA-b5HD10A-Ypy4hUv-b5H00uLKGujYs0ZF-uMKGujYs0APsThqGujY0mMNbuvNYgvN3TA-b5H00my-s5HNGU17hPWPNmvP80ZNGTjd9pAPEPAkRn-Pzu6KWpjY0IA7z5Hc0uZws5HD0TvN_UANzgv-b5Hc0pgPxmgKs5HD0mgKsgv-b5HnznHn1P1mkPWT0mLN1IjdlpZN9UyqB0A4-I7qYXgK-5HD0Uhqs5Hfvnj0s0A7bmhkEmvVxpvN45H00pgPxIv-zuyk-TLnqnfKLmgKxIZ-suHYs0AdEmh-_uNqsUA7YuhqzUHYz0AdETdqvugcqnB31QW00TAsqn0K_XAcqn0KVm1YkuHfYmhn3rfKVIWYk0A4vTjYsQW0snj0snj0s0AT45HD0uh-zTLwxThNMpyq85Hc0TvNWUv4bgLF-uv-EUWY3n1f0TLPs5Hc0TLPsnWYs0ZwYTjY10AwGTLws5H00mycqn0KWThnqnW64PHf0%26__mobads_cookie%3D%26__mobads_sid%3D723ff9d8572510f2&sn=863637021737296&clk=1
url请求json数据,返回400,但是浏览器正常返回json数据
url如下:rnhttp://openapi.aibang.com/bus/transfer?app_key=7eeb14a53837c654b96ccccc8bedfc2a&city=%E8%A5%BF%E5%AE%89&start_addr=%E7%A7%91%E6%8A%80%E4%BA%8C%E8%B7%AF&end_addr= %E7%94%B5%E5%AD%90%E4%BA%8C%E8%B7%AF&alt=jsonrnrngetResponseCode<em>返回</em><em>400</em>,但是浏览器访问能够正常<em>返回</em>数据。rnrn爱帮的其他api都能正常<em>返回</em>200,说明爱帮的api也是ok的。那问题出在哪里呢?
iOS AFNetworking 请求返回400,如何打印后台返回信息
比如 我在某次请求的时候某个 参数忘记 带了。后台<em>返回</em><em>400</em> 直接答应error就是bad Request ,而后台实际可能<em>返回</em>有提示信息,某个参数缺少等。可以直接方便调试。我该怎么在<em>返回</em>的task中打印后台<em>返回</em>的东西了
C#我写了个下载功能,报Status Code:200 Status Text:BADRESPONSE语法错误
[img=https://img-bbs.csdn.net/upload/201411/24/1416809420_894896.png][/img][img=https://img-bbs.csdn.net/upload/201411/24/1416809444_96704.png][/img][img=https://img-bbs.csdn.net/upload/201411/24/1416809457_228311.png][/img][img=https://img-bbs.csdn.net/upload/201411/24/1416809475_48613.png][/img]rn我写了个Excel下载功能,单步调试时没有报错,程序运行后页面会弹出这个错误,而且没有弹出下载选项
返回数组方法 return code 中的code 下面有波浪线怎么回事
private static int[] getBinary(String text) rn rn StringBuffer num = new StringBuffer();rn String s; rn char ch;rn rn for (int i = 0; i < text.length(); i++) rn // 把每个字符转换为二进制rn s = Integer.toBinaryString(text.charAt(i));rn // 转换的二进制代码如果少于八位把它转化为八位rn for (int j = 8 - s.length(); j > 0; j--) rn num.append(0);rn rn rn num.append(s);rn rn rn rn //此处的定义不能早也不能晚rn int len = num.length();rn int[] <em>code</em> = new int[len];rn for (int i = 0; i < len; i++)rn // Change each 0/1 char to int.rn rn <em>code</em>[i] = Character.getNumericValue(num.charAt(i));rn rn // int [] <em>code</em>copy=<em>code</em>;rn //return <em>code</em>copy; rnrn return <em>code</em>;rn    rn
django不会发邮件通知HTTP status code 500
我的django可以用rn[<em>code</em>=python]send_mail(rn... 'Subject here',rn... 'Here is the message.',rn... 'redstone-cold@163.com',rn... ['2281570025@qq.com'],rn... fail_silently=False,rn... )[/<em>code</em>]rn发送邮件,但是出现HTTP <em>status</em> <em>code</em> 500却不会发邮件通知,这是什么原因?详细描述看这里 http://stackoverflow.com/questions/41363888/django-doesnt-email-reporting-an-internal-server-error-http-<em>status</em>-<em>code</em>-500
谷歌浏览器弹框报错:Error:status code is 0
谷歌浏览器报错:Error:<em>status</em> <em>code</em> is 0rnrn[<em>code</em>=HTML] rnrn rnrn rnrn rnrn rnrn rn[/<em>code</em>]rnrn就是上面这段代码,键盘事件,当按下回车键的时候就提交表单页面跳转,但是在谷歌浏览器会弹出一个警告框Error:<em>status</em> <em>code</em> is 0,是为什么?别的ie,ff都好使~·不解。
Something went wrong - -32300 : transport error - HTTP status code was not 200
有谁见过这样的错误信息rnrn我所使用的环境是PHP5,jquery,jquery.form,rn每次的提交表单的时候就会有这错误,不知道是不是JSON的问题,还是什么问题.rn百度和google过了,没有确切的答案.
微信auth2.0认证获取code失败?返回code为null
今天用auth2.0,做微信端到H5的跳转,后台用java。重定向也没有问题,在actin中获取<em>code</em>为null,感觉很奇怪,于是单独写了一个测试页面输出<em>code</em>,同样显示为null.rn很是郁闷,请各位大神解惑,这是啥情况呢。。。rnhttps://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=<em>code</em>&scope=SCOPE&state=STATE#wechat_redirectrn根据微信给出的接口,只需要配置2个参数,现在跳转没问题,所以,redirect_uri=REDIRECT_URI没问题,appid 也没问题。但是为什么<em>code</em>是null呢。。。郁闷中
the status code returned from the server was:12031是什么错误?
the <em>status</em> <em>code</em> returned from the server was:12031或the <em>status</em> <em>code</em> returned from the server was:404是什么错误?/?
解决 -- 代码没有问题时接口报错:Status Code: 404 Not Found
我能确定这个工程的接口代码肯定没有问题,这时请求接口依旧报 404。如:经过多方检查  最终确认问题原因:KONG 网关配置不对。如下图,红框中的不能勾选,去掉勾选接口请求正常。...
常见的IT笔试知识题
协议端口问题 一、POP3收邮件: POP3: 110 POP3 SSL: 995 二、IMAP收邮件: IMAP: 143 IMAP SSL: 993 三、SMTP发邮件: SMTP: 25 SMTP SSL: 465 SMTP TLS: 587 HTTP协议问题 下面是常见的HTTP状态码: 200 - 请求成功301 - 资源(网页等
如何在jsp or servlet中得到status code?
谢谢
RESTful API 中的 Status code 是否要遵守规范
缘起 事情是这样的,我在知乎受到邀请回答一个问题,主要是问 ID 找不到到底要不要用 Status 404 。我回答的还是比较早的,那时候只有一两个回答。我本来以为这是没啥争议的,在一个学术的地方讨论学术问题,当然是要遵守规范了,结果过了几个小时大跌眼镜。自造 <em>code</em> 党竟然支持率第一,还好平时见的也很多的全 200 党没有受到支持,不...
Android BLE操作成功或失败status code对应解释
ble 蓝牙 错误 失败
an nuknown error occurred while processing the request on the server.the status code
小弟用了微软的atlas控件点击按钮的时候却报这个错误,求大侠们帮忙看一看。
静态类成员安全吗? The status code was:500 (分不够,再加)
我写了一个类App 其中有一个 static DataTable对象来保存在线用户的一些数据.rnrn每个页面 我都 用 App.IsLogin() 来判断用户是否登陆.rn在显示在线用户的页面,我通过操作App.OnlineUser来存取信息.rnrn在大多数情况下,他们都运行良好,网站运行几天 或者 几个小时后,就会有如下错误:rnrn1、在登陆页面我调用了 App.IsLogin(),他会提示这个DelOnlineUser 中的DataTable错误;如果是这个错误,连页面的都打不开,很郁闷整个网站就瘫痪了。rn2、因为用户名和密码验证我用了AJAX,所以如果App.Login错误 就会出现Sys.WebForms.......The <em>status</em> <em>code</em> was:500的错误。 这个错误出现了 基本上就能打开登陆页面,整个网站基本也就瘫痪了。rnrn我看了看我的代码,没有错误啊,就这几句 还能有什么大错误吗???rnrn是不是静态类成员不是线程安全所致的哦???rnrnrnPS:如果代码不全,1楼有补充的代码。。。rnrnrnpublic class App //用户信息类rnrn public static DataTable OnlineUser=new DataTable() ;rnrn public static void DelOnlineUser(string sid)rn rn if (OnlineUser.Columns.Count > 0)rn rn DataRow[] dc = OnlineUser.Select("sid='" + sid +"'" );rn if (dc.Length>0)rn dc[0].Delete();rn rn rn rn rn public static void SetOnlineUser()rn rnrn if (OnlineUser.Columns.Count == 0)rn rn OnlineUser.Columns.Add("id", typeof(System.Int32));rn OnlineUser.Columns.Add("sid", typeof(System.String));rn OnlineUser.Columns.Add("name", typeof(System.String));rn OnlineUser.Columns.Add("class", typeof(System.String));rn OnlineUser.Columns.Add("gary", typeof(System.String));rn OnlineUser.Columns.Add("ip", typeof(System.String));rn OnlineUser.Columns.Add("lasttime", typeof(System.DateTime));rn rn DataRow[] dc = OnlineUser.Select("sid='" + System.Web.HttpContext.Current.Session["sid"].ToString() +"'");rnrn if (dc.Length == 0) //通过 Session标记 设置在线情况rn rn DataRow dr = OnlineUser.NewRow();rn dr["id"] = (Int32)System.Web.HttpContext.Current.Session["id"];rn dr["sid"] = System.Web.HttpContext.Current.Session["sid"].ToString() ;rn dr["name"] = System.Web.HttpContext.Current.Session["name"].ToString();rn dr["class"] = System.Web.HttpContext.Current.Session["class"].ToString();rn dr["gary"] = System.Web.HttpContext.Current.Session["gary"].ToString();rn dr["ip"] = Getip();rn dr["lasttime"] =(DateTime)System.Web.HttpContext.Current.Session["lasttime"];rn OnlineUser.Rows.Add(dr);rn rn rn rn public static string Login(string username,string pass) // ""表示成功rn rn SqlConnection cn=new SqlConnection("server=" + ConfigurationSettings.AppSettings["SqlServerIp"] +rn ";database=" + ConfigurationSettings.AppSettings["SqlServerName"] + ";user=" + ConfigurationSettings.AppSettings["SqlServerUserName"] + ";password=" + ConfigurationSettings.AppSettings["SqlServerPassword"]);rn SqlCommand cmd=new SqlCommand("select TOP 1 * from [user] where username='"+username+"'",cn);rn SqlDataAdapter da=new SqlDataAdapter(cmd);rn SqlCommandBuilder cb = new SqlCommandBuilder(da); rn rn DataSet ds=new DataSet();//数据在内存的映射rn cn.Open();rn da.Fill(ds,"user");rn cn.Close();rn if (ds.Tables["user"].Rows.Count ;rnrn rnrn rn rn rnrn
HTTP status Code 412 未满足前提条件的解决方法之一
最近网站老是报告错误.  ajax<em>返回</em>状态为 error 思来想去不知道为啥. 后来跟踪了下,发现是在请求某个页面的时候会<em>返回</em>412错误.  而这个页面的请求是通过jquery  的 $("#panel").load("http://****"); 方法去请求的. 各种百度无果..  只得到一个结果.  412 未满足前提条件 前提条件失败  在服务器上测试前提条
IWEB_GetResponse GET 方式怎么上传中文数据
IWEB_GetResponse GET 方式怎么上传中文数据。我对中文数据进行了UTF-8编码,在服务器册抓包,发现其编码方式实际是ISO-8859-1,然后服务器解析出来的数据是乱码。这个要怎么处理?另外问下,IWEB_GetResponse可以设置编码方式吗?rnrn谢谢!
Android 使用HTTP Get方式提交数据,出现response code == 400
使用了调试方式,打算让android通过http的url传一个imei给web端,struts相应处理请求数据。rnrn下面是sendGetRequest源码:rn[<em>code</em>=Java]rnJava <em>code</em>public class HttpRequest rnrnrn // 利用get方法在url后添加imei参数传递给web端,同时web端将匹配imei的命令cmd通过response方法<em>返回</em>rn public static String sendGetRequest(String path, Map params, String enc) throws Exception rn StringBuilder sb = new StringBuilder(path); rn sb.append('?'); rn // ?imei= rn //把Map中的数据迭代附加到StringBuilder中 rn for(Map.Entry entry : params.entrySet()) rn //URLEn<em>code</em>r.en<em>code</em>对字符串中文进行编码,防止乱码 rn sb.append(entry.getKey()).append('=') rn .append(URLEn<em>code</em>r.en<em>code</em>(entry.getValue(), enc)).append('&'); rn rn //去掉最后一个字符& rn sb.deleteCharAt(sb.length()-1); rn //把组拼完的路径传到URL对象 rn URL url = new URL(sb.toString()); rn HttpURLConnection conn = (HttpURLConnection)url.openConnection(); rn //设置请求方式,GET要大写 rn conn.setRequestMethod("GET"); rn //设置过期时间为5秒rn conn.setConnectTimeout(5 * 1000); rn conn.getErrorStream();rn //"200"代表请求成功 rn if(conn.getResponseCode()==200) rn return sb.toString(); rn rn return null; rn rnrn[/<em>code</em>]rnrn调试结果是在if(conn.getResponseCode()==200)时ResponseCode==<em>400</em>,上网找了多个方法都无效,没使用代理,用的远程桌面连接编写程序,系统配置无权限改,求急救。rnrn网上有说是tomcat的编码方式不是UTF-8而是ISO88591-1,需要用过滤器实现编码方式切换(原文在这儿:http://blog.163.com/hf_savior/blog/static/1849320312011323113551496/),但是我看过之后也没看懂该怎么改,有没有谁能完整地解释一下应该怎么解决这个问题的,非常感谢。
求助:Spring + WebSocket 握手失败 Unexpected response code: 400
求助各位大神,现在我的WebSocket是这么配置的:rn注册类:rn[<em>code</em>=java]rn/**rn * WebSocket注册类rn *rn * @author zhangdanjirn * rn */rn@Configurationrn@EnableWebMvcrn@EnableWebSocketrnpublic class DataPresentationWebSocketConfig extends WebMvcConfigurerAdapter implements WebSocketConfigurerrnrn private Logger logger = LoggerFactory.getLogger(DataPresentationWebSocketConfig.class);rn rn /**rn * 注册WebSocketHandlerrn *rn * @author zhangdanjirn * @param registryrn * rn */rn @Overridern public void registerWebSocketHandlers(WebSocketHandlerRegistry registry)rn rn logger.info("---Begin Invoke:DataPresentationWebSocketConfig.registerWebSocketHandlers---");rn registry.addHandler(dataPresentationWebSocketHandler(), "/dataPresentationWebSocketServer.do").addInterceptors(new DataPresentationWebSocketInterceptor());rn rn rn @Beanrn public WebSocketHandler dataPresentationWebSocketHandler()rn return new DataPresentationWebSocketHandler();rn rnrnrn[/<em>code</em>]rnhandler:rn[<em>code</em>=java]rn/**rn * WebSocketHandler类rn *rn * @author zhangdanjirn * rn */rnpublic class DataPresentationWebSocketHandler extends TextWebSocketHandlerrnrnrn private Logger logger = LoggerFactory.getLogger(DataPresentationWebSocketHandler.class);rn public static final List LOGIN_USERS = Collections.synchronizedList(new ArrayList()); rn rn @Autowiredrn private DataPresentationService dataPresentationService;rn rn /**rn * WebSocket连接创建rn *rn * @author zhangdanjirn * @param sessionrn * rn */rn @Overridern public void afterConnectionEstablished(WebSocketSession session) throws Exceptionrn rn logger.info("---Begin Invoke:DataPresentationWebSocketHandler.afterConnectionEstablished---");rn LOGIN_USERS.add(session); //将登录的WebSocketSession放入缓存中rn logger.info("---用户" + WebSocketUtil.getSysUserFromWebSocketSession(session).getName() + "WebSocket连接已建立---");rn rnrn /**rn * WebSocket接受消息并发送rn *rn * @author zhangdanjirn * @param sessionrn * messagern * rn */rn @Overridern protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exceptionrn rn logger.info("---Begin Invoke:DataPresentationWebSocketHandler.handleTextMessagemessage:" + message.getPayload() + "---");rn //根据页面消息设置工作标识rn if("WEBSOCKET_IS_WORK".equals(message.getPayload()))rn //WebSocket启动工作rn WebSocketUtil.setWebSocketWorkFlag(session, true);rn logger.info("---用户" + WebSocketUtil.getSysUserFromWebSocketSession(session).getName() + "WebSocket开始工作---");rn else if("WEBSOCKET_STOP_WORK".equals(message.getPayload()))rn //WebSocket停止工作rn WebSocketUtil.setWebSocketWorkFlag(session, false);rn logger.info("---用户" + WebSocketUtil.getSysUserFromWebSocketSession(session).getName() + "WebSocket停止工作---");rn else if(message.getPayload().startsWith("WEBSOCKET_BIND_USER"))rn //绑定WebSocketSession用户rn String bindUserId = message.getPayload().substring(message.getPayload().indexOf(":") + 1);rn if(StringUtils.isEmpty(bindUserId) || !StringUtils.isInteger(bindUserId))rn throw new RuntimeException("绑定的用户ID不存在或不是整数类型");rn rn WebSocketUtil.setWebSocketBindUser(session, Integer.parseInt(bindUserId));rn rn else if(message.getPayload().startsWith("WEBSOCKET_REFRESH_ALL_DATA"))rn //刷新所有数据rn String updateUserId = message.getPayload().substring(message.getPayload().indexOf(":") + 1);rn logger.info("---用户" + WebSocketUtil.getSysUserFromWebSocketSession(session).getName() + "刷新用户" + updateUserId + "所有数据---");rn if(StringUtils.isEmpty(updateUserId) || !StringUtils.isInteger(updateUserId))rn throw new RuntimeException("更新数据的用户ID不存在或不是整数类型");rn rn SysUser updateUser = new SysUser(Integer.parseInt(updateUserId));rn dataPresentationService.updateDataPresentation(updateUser, 0);rn elsern //WebSocket设置是否启用标识,若启用则发送消息rn Boolean isWork = WebSocketUtil.getWebSocketWorkFlag(session);rn if(isWork)rn session.sendMessage(new TextMessage(message.getPayload()));rn elsern logger.info("---INFO:用户" + WebSocketUtil.getSysUserFromWebSocketSession(session).getName() + "WebSocket未启用工作---");rn rn rn rnrn /**rn * WebSocket处理异常rn *rn * @author zhangdanjirn * @param sessionrn * exceptionrn * rn */rn @Overridern public void handleTransportError(WebSocketSession session, Throwable exception) throws Exceptionrn rn logger.info("---Begin Invoke:DataPresentationWebSocketHandler.handleTransportErrorexception:" + exception.getMessage() + "---");rn logger.info("---用户" + WebSocketUtil.getSysUserFromWebSocketSession(session).getName() + "WebSocket因异常关闭---");rn if(session.isOpen()) rn session.close(); rn rn LOGIN_USERS.remove(session); rn rnrn /**rn * WebSocket关闭连接rn *rn * @author zhangdanjirn * @param sessionrn * closeStatusrn * rn */rn @Overridern public void afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus) throws Exceptionrn rn logger.info("---Begin Invoke:DataPresentationWebSocketHandler.afterConnectionClosedcloseStatus:" + closeStatus + "---");rn logger.info("---用户" + WebSocketUtil.getSysUserFromWebSocketSession(session).getName() + "WebSocket关闭---");rn LOGIN_USERS.remove(session); rn rnrn /**rn * WebSocket局部消息rn *rn * @author zhangdanjirn * rn */rn @Overridern public boolean supportsPartialMessages()rn rn return false;rn rnrnrn[/<em>code</em>]rninterceptor:rn[<em>code</em>=java]rn/**rn * WebSocket拦截器rn *rn * @author zhangdanjirn * rn */rnpublic class DataPresentationWebSocketInterceptor extends HttpSessionHandshakeInterceptorrnrn private Logger logger = LoggerFactory.getLogger(DataPresentationWebSocketInterceptor.class);rnrn @Overridern public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler,rn Map attributes) throws Exceptionrn rn logger.info("---Begin Invoke:DataPresentationWebSocketInterceptor.beforeHandshake---");rn if (request instanceof ServletServerHttpRequest) rn //从request中获取user信息放入WebSocketSession中rn ServletServerHttpRequest servletRequest = (ServletServerHttpRequest) request;rn HttpServletRequest req = servletRequest.getServletRequest();rn SysUser user = UserUtil.getUser(req);rn attributes.put("LOGIN_USER", user);rn rn return super.beforeHandshake(request, response, wsHandler, attributes);rn rn rnrn[/<em>code</em>]rnjs:rn[<em>code</em>=javascript]rn// WebSocket对象rnvar url = crmUrl.replace("http://","ws://") + "/dataPresentationWebSocketServer.do";rnvar _webSocket = rn socket : null, // WebSocket连接对象 rn host : '', // WebSocket连接 url rn connect : function() // 连接服务器 rn window.WebSocket = window.WebSocket || window.MozWebSocket; rn if (!window.WebSocket) // 检测浏览器支持 rn top.showMsg("", "当前浏览器不支持WebSocket,无法更新数据", true, "warning");rn return; rn rn this.socket = new WebSocket(this.host); // 创建连接并注册响应函数 rn this.socket.onopen = onOpenCallBack; rn this.socket.onmessage = onMessageCallBack; rn this.socket.onclose = function() rn _webSocket.socket = null; // 清理 rn ; rn , rn send : function(message) // 发送消息方法 rn if (this.socket) rn this.socket.send(message); rn return true; rn rn top.showMsg("", "WebSocket未连接!", true, "warning");rn return false; rn rn; rn// 初始化WebSocket连接 url rn_webSocket.host = url; rnrnif(!_webSocket.socket)rn //建立WebSocket连接rn _webSocket.connect();rnrn[/<em>code</em>]rnrn以上是代码,我在本机和sit环境测试的都没有问题,但是转测得时候由于域名格式不一样就有WebSocket connection to 'ws://crm.to3.mychebao.com/dataPresentationWebSocketServer.do' failed: Error during WebSocket handshake: Unexpected response <em>code</em>: <em>400</em>这个问题rn本机WebSocket地址是http://127.0.0.1:8080/crm-web/dataPresentationWebSocketServer.dornsit环境地址是http://boss.sit2.mychebao.com:8080/crm-web/dataPresentationWebSocketServer.dorn转测之后地址是http://boss.to3.mychebao.com/dataPresentationWebSocketServer.dorn转测之后的环境是把端口号、项目名全部集成在一个域名下,这个环境就会报这个错,求大神帮忙看一下!!
请教Java 网络编程 Server returned HTTP response code: 400
下面是简单的代码:rnURL url = new URL(uri);rn URLConnection rulConnection = url.openConnection();rn HttpURLConnection httpUrlConnection = (HttpURLConnection) rulConnection; rn httpUrlConnection.setDoInput(true); rn httpUrlConnection.setUseCaches(false); rn httpUrlConnection.setRequestMethod("POST"); rn httpUrlConnection.connect(); rn InputStreamReader isr =new InputStreamReader(httpUrlConnection.getInputStream(),"GB2312");rnrn如果我的uri 是http://search.jd.com/Search?keyword=华为&enc=utf-8&area=2 没问题,能够读取网页内容rn可是换成http://item.jd.com/827017.html 就会抛异常rnrnjava.io.IOException: Server returned HTTP response <em>code</em>: <em>400</em> for URL: http://item.jd.com/827017.htmlrn at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)rn at ReadURL.getBufferedFromURL(ReadURL.java:12)rn at ReadURL.getItemDetail(ReadURL.java:29)rn at ReadURL.main(ReadURL.java:83)rnjava.lang.NullPointerExceptionrnrnrn请问这是为什么同一个网站的不同网址,为什么有的能访问,有的抛异常?
QQ登陆返回 msg : code is reused error
redirect_uri = U('oauth/callback', array('mod'=>'qq'), '', '', true);rn $this->setting = $setting;rn rn /**rn * 获取授权地址rn */rn function getAuthorizeURL() rn $oauth = new QqTOAuthV2($this->setting['app_key'], $this->setting['app_secret']);rn return $oauth->getAuthorizeURL($this->redirect_uri);rn rnrn /**rn * 获取用户信息rn */rn public function getUserInfo($request_args) rn $oauth = new QqTOAuthV2($this->setting['app_key'], $this->setting['app_secret']);rn $keys = array('<em>code</em>'=>$request_args['<em>code</em>'], 'state'=>$request_args['state'], 'redirect_uri'=>$this->redirect_uri);rn $token = $oauth->getAccessToken($keys);rn $openid = $oauth->getOpenid($token["access_token"]);rn $user = $oauth->getUserInfo($token["access_token"], $openid);rn $result['keyid'] = $openid;rn $result['keyname'] = urlde<em>code</em>($user['nickname']);rn //$result['keyavatar_small'] = $user['figureurl'];rn //$result['keyavatar_big'] = $user['figureurl_2'];rn $result['keyavatar_small'] = '';rn $result['keyavatar_big'] = '';rn $result['bind_info'] = $token;rn return $result;rn rnrn /**rn * 推送信息rn */rn public function send($bind_user, $data) rn $token = unserialize($bind_user['info']);rn $client = new QqTOAuthV2($this->setting['app_key'], $this->setting['app_secret']);rn try rn $return = $client->add_topic($token['access_token'], $bind_user['keyid'], array(rn 'format' => '',rn 'richtype' => '2',rn 'richval' => $data['url'],rn 'con' => $data['content'],rn 'lbs_nm' => '',rn 'lbs_x' => '',rn 'lbs_y' => '',rn 'third_source' => '',rn ));rn catch(Exception $e)rn rn public function getFriends($bind_user, $page, $count) rn rn rn public function follow($bind_user, $uid) rn rn rn public function NeedRequest() rn return $this->_need_request;rn rn
java实现二分查找IP 返回指定的code
package Test; import java.io.*; import java.nio.charset.StandardCharsets; import java.util.LinkedList; /** * @Author: lsp * @Date: 2018/12/7 17:53 * @Description: */ public class IPUtil { /...
Visual studio Code 跳转定义返回快捷键
  windows系统: Alt+← .. navigate back Alt+→ .. navigate forward Mac系统: Ctrl+- .. navigate back Ctrl+Shift+- .. navigate forward On Ubuntu Linux系统: Ctrl+Alt+- .. navigate back Ctrl+Shift+- .. na...
高德定位错误返回code = 2
解决方案 重启手机。。。。。。
数据结构c++多项式下载
数据结构用c++实现多项式运算的基本操作 相关下载链接:[url=//download.csdn.net/download/y530983563/2497611?utm_source=bbsseo]//download.csdn.net/download/y530983563/2497611?utm_source=bbsseo[/url]
路由器通用密码,值得珍藏下载
包括常用路由器的密码及部分密码忘记的破解方法,值得珍藏. 相关下载链接:[url=//download.csdn.net/download/yzlyccql/3421844?utm_source=bbsseo]//download.csdn.net/download/yzlyccql/3421844?utm_source=bbsseo[/url]
给软件加上注册机下载
给软件加上注册机 是使用E语言编写而成,供大家参考而写。 相关下载链接:[url=//download.csdn.net/download/hongfu128/5226063?utm_source=bbsseo]//download.csdn.net/download/hongfu128/5226063?utm_source=bbsseo[/url]
相关热词 c#异步发送kafka c#窗体编号 c# 操作二进制文件 c# 反射 机制 c#线程 窗体失去响应 c#角度转弧度 c# 解析gps数据 c# vs设置 语法版本 c# json含回车 c#多线程demo
我们是很有底线的