cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CXF-6677) Content-Type is empty on POST request with empty body
Date Mon, 16 Nov 2015 21:08:10 GMT

     [ https://issues.apache.org/jira/browse/CXF-6677?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sergey Beryozkin resolved CXF-6677.
-----------------------------------
       Resolution: Fixed
         Assignee: Sergey Beryozkin
    Fix Version/s: 3.2.0
                   3.0.8
                   3.1.5

Workaround: can set a media type directly with WebClient.getConfig(proxy) or setHeaders on
the client factory bean

> Content-Type is empty on POST request with empty body 
> ------------------------------------------------------
>
>                 Key: CXF-6677
>                 URL: https://issues.apache.org/jira/browse/CXF-6677
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 3.1.4
>            Reporter: Pavel Kokush
>            Assignee: Sergey Beryozkin
>             Fix For: 3.1.5, 3.0.8, 3.2.0
>
>
> I have following code:
> endpoint:
> {code}@Path("/")
> @Produces(MediaType.APPLICATION_JSON)
> @Consumes(MediaType.APPLICATION_JSON)
> public interface MyApi
> {
> 	@Path("invoices/{number}/bookkeep")
> 	@PUT
> 	String bookkeep(@PathParam("number") String invoiceNumber);
>         ...
> }{code}
> client configuration:
> {code}JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
> bean.setAddress("http://localhost");
> bean.setInheritHeaders(true);
> bean.setThreadSafe(true);
> bean.setServiceClass(MyApi.class);
> MyApi myApi = bean.create(MyApi.class);{code}
> When I run
> {code}myApi.bookkeep("111");{code}
> Result:
> {code}Http-Method: PUT
> Content-Type: 
> Headers: {Access-Token=[aaa], Accept=[application/json]}{code}
> Expected: 
> {code}...
> Content-Type: application/json
> ...{code}
> With cxf-rt-rs-client version 3.0.3 Content-Type is application/json.
> With cxf-rt-rs-client version 3.1.4 Content-Type is empty.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message