caelum / restfulie-java

restfulie implementation in java, with support to vraptor
http://github.com/caelum/restfulie-java
Other
94 stars 28 forks source link

caracter truncation on post data #44

Open ghost opened 12 years ago

ghost commented 12 years ago

client code with charset on content type likes

restfulie .at("http://localhost:8081/faturamento/boleto/create") .as("application/xml;charset=utf-8").accept("application/xml").post(object)

generates an exception

Exception in thread "main" br.com.caelum.restfulie.RestfulieException: Unsupported media type 'application/xml;charset=utf-8' at br.com.caelum.restfulie.mediatype.MediaTypes.forContentType(MediaTypes.java:27) at br.com.caelum.restfulie.http.apache.ApacheDispatcher.handlerFor(ApacheDispatcher.java:92) at br.com.caelum.restfulie.http.apache.ApacheDispatcher.process(ApacheDispatcher.java:73) at br.com.caelum.restfulie.request.RequestStack.process(RequestStack.java:38) at br.com.caelum.restfulie.request.RequestChain.next(RequestChain.java:20) at br.com.caelum.restfulie.request.RequestStack.process(RequestStack.java:29) at br.com.caelum.restfulie.http.DefaultHttpRequest.sendPayload(DefaultHttpRequest.java:43) at br.com.caelum.restfulie.http.DefaultHttpRequest.post(DefaultHttpRequest.java:98) at br.com.jslsolucoes.faturamento.service.impl.FaturamentoRestServiceImpl.create(FaturamentoRestServiceImpl.java:73) at br.com.jslsolucoes.faturamento.service.impl.FaturamentoRestServiceImpl.main(FaturamentoRestServiceImpl.java:28)

without charset type works fine but truncate acentuation os server side

guilhermesilveira commented 12 years ago

the as method should have splitted the string into two. definately a bug