解决接口Server returned HTTP response code: 505
来源:互联网 发布:sql 安装错误sku 编辑:程序博客网 时间:2024/06/15 01:38
在JEE开发中,有时候需要两个系统(工程)之间进行访问或数据交换,我这里用了非常传统的方法,就是使用http请求,当然这可能只适用于业务比较简单、不太重视安全的系统。
当使用http请求的时候,会经常在url后面带参数,比如:http://"+ip+":"+port+"/LWGL/dcsj/time/queryTimePie.html?gczbs=81zcScto26w&year=2016&startTime=2016-07-12 00:00:00&endTime=2016-07-12 23:59:59&dataType=2
参数时间经常会带有空格。
但有一次我使用这种方法的时候,后台报错了:
java.io.IOException: Server returned HTTP response code: 505 for URL: http://192.168.1.109:8080/test/moblie/this.do?info=hello world at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) ...........
后来检查了一遍,发现是参数info后面有空格,不管是post还是get都会有上面的那个错,具体更加深入的分析就我就没有做了,把空格去掉就OK了。如果非得要空格,可以在传参数的时候,用一个符号来代替空格,另外的方法接收到这个参数后,再将这个符号替换成空格即可。
比如:
String
downloadFileName = downloadFileName.replaceAll("\\+", " "); //将加号还原为空格
或者
downloadFileName = downloadFileName.replaceAll(" ", " "); //将空格进行转化
0 0
- 解决接口Server returned HTTP response code: 505
- 解决Server returned HTTP response code: 505
- Server returned HTTP response code: 505 问题解决
- Server returned HTTP response code: 500
- Server returned HTTP response code: 500 for URL: http.......错误
- java.io.IOException: Server returned HTTP response code: 505 for URL: http://localhost:8080/fish/add
- 关于Server returned HTTP response code: 403 for URL
- Server returned HTTP response code: 500 for URL解决方法
- Server returned HTTP response code: 416 for UR
- Server returned HTTP response code: 500 for URL
- 关于Server returned HTTP response code: 403 for URL
- java.io.IOException Server returned HTTP response code 415
- Server returned HTTP response code: 500 for URL:
- java.io.IOException: Server returned HTTP response code: 505 for URL: 问题
- java.io.IOException: Server returned HTTP response code: 403 for URL: http://
- java.io.IOException: Server returned HTTP response code: 403 for URL: http://
- java.io.IOException: Server returned HTTP response code: 403 for URL: http://的解决办法
- Server returned HTTP response code: 403 for URL: http://blog.csdn.net
- Fragment与Activity交互方式使用Bundle
- linux内核list.h头文件分析(六)——hlist分析
- NBUT1218 You are my brother(弱化版带权并查集)
- 将系统的framework api添加到sdk中去
- 数据结构字符串匹配——Brute-Force算法
- 解决接口Server returned HTTP response code: 505
- 实现非递归表达
- QT计算器功能的实现
- 巧记const, char, *的区别
- Android okHttp网络请求之Retrofit+Okhttp+RxJava组合
- 总结SSH阶段常见的异常系列之一hibernate
- TCP详解
- Arena777 Casino Malaysia Baccarat Triple Bonus(arena777, arena777 casino malaysia, arena777 existing
- ASP.NET Core 操作数据库提示“Microsoft.EntityFrameworkCore.DbUpdateException”