java.io.IOException: Server returned HTTP response code: 400 for URL解决方法
来源:互联网 发布:凯立德v6.0端口修改器 编辑:程序博客网 时间:2024/06/04 08:54
错误:java.io.IOException: Server returned HTTP response code: 400 for URL
在使用JAVA发起http请求的时候,经常会遇到这个错误,我们copy请求地址在浏览器中运行的时候又是正常运行的,造成这个错误的原因主要是因为请求的URL中包含空格,这个时候我们要使用URLEncoder.encode(timestamp,"utf-8")对含有空格的参数进行处理;(注:只对需要处理的参数部分进行处理,不要把整个URL放进去,如果整个URL放进去会对URL中的"//"也会进行处理);
String timestamp=DateUtils.DateToString(new Date(), DateUtils.YYYY_MM_DD_HH_MM_SS);
//2014-01-21 17:33:11 处理前
//2014-01-21+17%3A44%3A38 //处理后
0 0
- java.io.IOException: Server returned HTTP response code: 400 for URL解决方法
- Exception in thread "main" java.io.IOException: Server returned HTTP response code: 400 for URL解决方案
- java.io.IOException: Server returned HTTP response code: 403 for URL: http://
- java.io.IOException: Server returned HTTP response code: 505 for URL: http://localhost:8080/fish/add
- 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: 500 for URL
- java.io.IOException: Server returned HTTP response code: 500 for URL
- 用户代理及 java.io.IOException: Server returned HTTP response code: 403 for URL
- java.io.IOException: Server returned HTTP response code: 505 for URL: 问题
- java.io.ioexception: server returned http response code: 500 for url:
- java.io.IOException: Server returned HTTP response code: 403 for URL
- [报错总结]java.io.IOException: Server returned HTTP response code: 500 for URL:
- 用户代理异常:java.io.IOException: Server returned HTTP response code: 403 for URL
- java.io.IOException: Server returned HTTP response code: 500 for URL解决办法
- java.io.IOException: Server returned HTTP response code: 405 for URL: *********处理方法
- java.io.IOException: Server returned HTTP response code: 415 for URL:xxxxxx
- java.io.IOException: Server returned HTTP response code: 405 for URL:
- iOS中的CoreImage
- 关于Go,十件你可能不知道的事
- 10分钟内把永远跑不完的存储过程变为2秒跑完
- java性能的一些常用的命令与注意点
- JS中undefined,null,"",0和false的区别
- java.io.IOException: Server returned HTTP response code: 400 for URL解决方法
- 关于Cookie
- 软件工程——软件测试
- 1294. 高级机密……快速幂取模 跟数学有关啊~晕了
- myeclipse8.5增添tomact7
- eclipse创建python项目提示Project interpreter not specified
- vim保存文件”:wq"与“:x"的区别
- Dimmdrive - Ramdisk For Gamers - Speeds Of 5,000 To 10,000 Mb/s!
- (八)回溯法