Restlet consume post webservice, add json-string as representation
I want to consume a rest webservice using restlet. This will be done with a post. What do I need to add to the following code:
ClientResource resource = new ClientResource("url"); resource.setChallengeResponse(ChallengeScheme.HTTP_BASIC, user, password);
I have a Json string and in the code where my rest-webservice is implemented the input is an Representation object. I need my parameter to be(being the jsonstring) in the enitity.gettext() method if possible.
public StartProcessInstanceResponse startProcessInstance(Representation entity) jsonstring = entity.gettext();
Thanks in advance.
Found the answer myself... You should make a Represenation object like this
Representation rep = new StringRepresentation(jsonString);
Then you can post like this: