Closed dimartiro closed 9 years ago
Solved using a custom encoder
http.encoder.'application/json' = { requestData ->
def jsonData = requestData as grails.converters.JSON
def entity = new org.apache.http.entity.StringEntity( (String) jsonData);
entity.setContentType( "application/json" );
return entity
}
Im trying to post something like this
{ "flag": false, "data": "{a:2,b:2,c:2}" }
where the value of "data" is a string with json format but not a json object.
My problem is that when I try to request with this body, httpbuilder transforms the "data" value from string to json object and this brake the api who receives that data.
Some ideas?
Thks