|
|
导航: |
论坛 -> DELPHI技术
斑竹:liumazi,sephil |
|
作者: |
|
2017/3/26 12:06:55 |
标题: |
使用restclient 调用 java的rest 服务问题 |
浏览:793 |
|
加入我的收藏 |
楼主: |
首先 使用restclient 调用java的rest服务,在url比较正常的情况下没有问题 如:http://localhost:8080/rest/def/getcandef/1490424181418 这样数据能正常返回 问题在于 在url地址中添加 相应的json参数就不对了 如:http://localhost:8080/rest/def/updatefds/{"fdsno":1,"describe":"河内你好","canipno":2,"scanflag":1,"fdstype":"S","opt":"update"}/1490424350230
提示错误为:EIdHTTPProtocolException with message 'HTTP/1.1 404 Not Found'
把上面带有json 的rest 地址 在firefox 中提交 能正常返回数据。
很是奇怪,哪位大师有思路解决该问题,不胜感激!
----------------------------------------------
- |
作者: |
|
2017/3/26 17:16:57 |
1楼: |
唉 自己解决了。折腾我一天。。 主要是需要先使用TIdURI.URLEncode 然后 把RESTRequest1.URLAlreadyEncoded := true; 设置一下。。。 就ok了。。
----------------------------------------------
-
|
|