Ticket #480 (new task)

Opened 12 months ago

JAX-RS encoding issue when handling put/post with string argument

Reported by: jgou Owned by: bruno
Priority: major Milestone: 0.4
Component: modules/kauri-routing Version: trunk
Keywords: Cc:

Description

This looks the same as issue #225, but seems to have another (yet also situated in restlet + jax-rs code) cause. I reported this issue to the restlet community: https://github.com/restlet/restlet-framework-java/issues/603 .

Workarounds:

@PUT
@Consumes("application/json")
public void updateFoo(byte[] jsonBytes) {
  String jsonString = new String(bytes,"UTF-8");
  // ...
}

or

@PUT
@Consumes("application/json")
public void updateFoo(org.json.JSONObject jso) {
  //if needed: String jsonString = jso.toString();
  // ...
}
Note: See TracTickets for help on using tickets.