为什么我这样访问传参的时候报错,说我的格式不对,505错误。
```String ss="{\"MESSAGE\": {\"-ID\": \"05-2013-10-30 10:10:0000\",\"TYPE\":\"05\",\"TIME\":\"2013103010:10:00\",\"BODY\": {\"INFORMATION\": {\"DESTINATION\": {\"SHIP_ID\":\"\"},\"BODY\"{\"USERNAME\":\"a\",\"PASSWORD\":\"a\"}}}}}";
String url1="http://192.168.46.35:8080/BGpsWeb/gpsForeignInterface/shipLocation.do?xmlStr="+ss;
HTTP 505错误是HTTP状态码的一种,表示“HTTP版本不受支持”,当服务器不支持请求中所使用的HTTP协议版本时就回返回此错误
xmlStr="+ss;这个怎么这么写
在GET请求后面多加了一个空格。请求内容如下:
GET /mwatch//upload/icon/content/1277456314876.png HTTP/1.1/r/nHost: 124.42.108.195:61000/r/nUser-Agent: NokiaN73-1/4.0736.3.2.1 Series60/3.0 Profile/MIDP-2.0 Configuration/CLDC-1.1/r/n/r/n
GET后面是两个空格。http协议真是太严格了,一点点差别都无法通过。
这个服务器大概是Linux, 客户端好像是Windows
你的ssl里面有很多特殊字符,而且又太长,建议放在post中提交,并且对参数做url编码。
String url1="http://192.168.46.35:8080/BGpsWeb/gpsForeignInterface/shipLocation.do?xmlStr="+encodeURIComponent(ss);
String url1="http://192.168.46.35:8080/BGpsWeb/gpsForeignInterface/shipLocation.do?xmlStr="+encodeURIComponent(ss);
会不会 \"-ID\": 你这里多 - 的问题
encodeURIComponent(ss); 这样试试看看。。