0

URL is : http://xx.xx.xx.xx:9080/myprocess?action=start&params={\"inputName\":\"Test\"}

In the above URL my JSON String is {\"inputName\":\"omsai\"}

I am calling the Apache Wink Rest(POST) call in the following way, but it is not working. I am getting java.net.URISyntaxException .

 secHandler.setUserName(userName);
 secHandler.setPassword(passWord);
 secHandler.setSSLRequired(false);

 ClientConfig clientConfig = new ClientConfig();
 clientConfig.handlers(secHandler);
 RestClient restClient = new RestClient(clientConfig);
 Resource resource = restClient.resource("http://xx.xx.xx.xx:9080/myprocess?action=start&params={\"inputName\":\"Test\"}");
 String response  response = resource.contentType(MediaType.APPLICATION_FORM_URLENCODED_TYPE).accept(MediaType.APPLICATION_JSON).post(String.class,"");
4

1 に答える 1

0
Here is the code 


secHandler.setUserName(userName);
 secHandler.setPassword(passWord);
 secHandler.setSSLRequired(false);

 ClientConfig clientConfig = new ClientConfig();
 clientConfig.handlers(secHandler);
 RestClient restClient = new RestClient(clientConfig);
 Resource resource = restClient.resource("http://xx.xx.xx.xx:9080/myprocess?action=start
String jsonString ="params={\"inputName\":\"Test\"}")";
 String response  response = resource.contentType(MediaType.APPLICATION_FORM_URLENCODED_TYPE).accept(MediaType.APPLICATION_JSON).post(String.class,jsonString);
于 2013-01-11T12:37:09.533 に答える