首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >哪个版本的spring集成支持http方法“修补程序”?

哪个版本的spring集成支持http方法“修补程序”?
EN

Stack Overflow用户
提问于 2014-07-22 07:42:55
回答 1查看 2.9K关注 0票数 3

我试图使用http-方法“修补程序”更新一列,并得到以下错误。密码是-

代码语言:javascript
运行
AI代码解释
复制
<int:chain input-channel="updateChannel">
 <int:service-activator ref="trackingNumberProcessor" method="message"/>
    <int-http:outbound-gateway url="http://test.com/consumerappointment/appointments/1295" http-method="PATCH" expected-response-  type="java.lang.String" charset="UTF-8">
    </int-http:outbound-gateway>     
</int:chain>


Caused by: org.springframework.web.client.ResourceAccessException: I/O error on PATCH request for "http://test.com/consumerappointment/appointments/1295":Invalid HTTP method: PATCH; nested exception is java.net.ProtocolException: Invalid HTTP method: PATCH
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:561) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE]
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:521) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE]
    at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:466) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE]
    at org.springframework.integration.http.outbound.HttpRequestExecutingMessageHandler.handleRequestMessage(HttpRequestExecutingMessageHandler.java:421) ~[spring-integration-http-4.0.0.RELEASE.jar:na]
    ... 62 common frames omitted
Caused by: java.net.ProtocolException: Invalid HTTP method: PATCH
    at java.net.HttpURLConnection.setRequestMethod(HttpURLConnection.java:428) ~[na:1.7.0_51]
    at org.springframework.http.client.SimpleClientHttpRequestFactory.prepareConnection(SimpleClientHttpRequestFactory.java:213) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE]
    at org.springframework.http.client.SimpleClientHttpRequestFactory.createRequest(SimpleClientHttpRequestFactory.java:141) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE]
    at org.springframework.http.client.support.HttpAccessor.createRequest(HttpAccessor.java:76) ~[spring-web-4.0.6.RELEASE.jar:4.0.6.RELEASE]
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-07-22 11:22:53

由: java.net.HttpURLConnection.setRequestMethod(HttpURLConnection.java:428):无效的HTTP方法引起: org.springframework.http.client.SimpleClientHttpRequestFactory.prepareConnection(SimpleClientHttpRequestFactory.java:213) ~Spring-Web4.0.6.RELEASE.jar:4.0.6.RELEASE处的修补程序

使用HttpComponentsClientHttpRequestFactory代替:

代码语言:javascript
运行
AI代码解释
复制
<int-http:outbound-gateway url="http://test.com/consumerappointment/appointments/1295" 
              http-method="PATCH" 
              expected-response-type="java.lang.String" 
              request-factory="clientHttpRequestFactory"
              charset="UTF-8" />

<beans:bean id="clientHttpRequestFactory" class="org.springframework.http.client.HttpComponentsClientHttpRequestFactory"/>
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24891876

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档