Guest User

Untitled

a guest
Mar 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. HttpResponse<String> jsonResponse = null;
  2. try {
  3. jsonResponse = Unirest.post(targetURL).header("Accept", "application/json")
  4. .header("Content-Type", "application/json;").body(urlParameters).asString();
  5. } catch (UnirestException e) {
  6. // TODO Auto-generated catch block
  7. e.printStackTrace();
  8. }
  9. String str = jsonResponse.toString();
  10. HttpInputMessage inputMessage = null;
  11.  
  12. return inputMessage;
  13.  
  14. RoutesList routes = new RoutesList();
  15. Post post = new Post(this.url + allRoutes, depoId.toString());
  16. HttpInputMessage inputMessage = null;
  17. try {
  18. inputMessage = post.getResult();
  19. } catch (Exception e1) {
  20. // TODO Auto-generated catch block
  21. e1.printStackTrace();
  22. }
  23. try {
  24. converter.read(routes.getClass(), RoutesList.class, inputMessage);
  25. } catch (HttpMessageNotReadableException e) {
  26. // TODO Auto-generated catch block
  27. e.printStackTrace();
  28. } catch (IOException e) {
  29. // TODO Auto-generated catch block
  30. e.printStackTrace();
  31. }
  32.  
  33. HttpComponentsAsyncClientHttpResponse(HttpResponse httpResponse)
  34.  
  35. return new HttpComponentsAsyncClientHttpResponse(jsonResponse)
Add Comment
Please, Sign In to add comment