guvnor 的 rest api中 post函数 建立一个package总是报405 get与delete都过了。
378938974
2012-12-24
今天公司在研究drools时,在调用guvnor的rest api时其post 方法总是报如下异常,但 get与delete方法都通过。所以排除是权限问题。有用过的大仙没?求教!url:http://guvnor.jdpay.360buy.net:7003/rest/packages/test
ResponseCode: 405 MediaType: text/html;charset=utf-8 Exception in thread "main" java.io.IOException: Server returned HTTP response code: 405 for URL: http://guvnor.jdpay.360buy.net:7003/rest/packages/test at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1491) at java.security.AccessController.doPrivileged(Native Method) at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1485) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1139) at java.net.URLConnection.getContent(URLConnection.java:688) at com.jd.payment.risk.common.library.GuvnorLibrary.main(GuvnorLibrary.java:52) Caused by: java.io.IOException: Server returned HTTP response code: 405 for URL: http://guvnor.jdpay.360buy.net:7003/rest/packages/test at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1436) at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379) at com.jd.payment.risk.common.library.GuvnorLibrary.main(GuvnorLibrary.java:48) |
|
378938974
2012-12-24
The POST method creates a new package from an input stream of DRL, an Atom feed, JSON, or XML, and returns the newly created package in the requested format (Atom feed, JSON, or XML). 文档中只有这么一段描述,但列子给的都是GET方式,很纠结。按这段描述分析应该是我的post方式问题,但是在文档中却没有明确指出.
|
相关讨论
相关资源推荐
- Go必知必会系列:REST API与Swagger
- 在 .NET Core 中构建 REST API
- 使用PHP创建一个REST API(Create a REST API with PHP)
- 使用Protobuf推动微服务和REST API的开发
- 用ASP.NET Core 2.0 建立规范的 REST API -- DELETE, UPDATE, PATCH 和 Log
- 第三章(续)、使用SpringBoot构建Rest API
- 使用PHP创建一个REST API(译)
- 编写REST API
- rest api如何创建_我的宝宝走了一步,创建了一个REST API并进行了码头化
- rest api 示例2_REST API教程– REST Client,REST Service和API调用通过代码示例进行了解释