Jagger
 All Classes Namespaces Files Functions Variables Groups Pages
HttpRequestBase com.griddynamics.jagger.invoker.http.HttpInvoker.getHttpMethod ( HttpQuery  query,
String  endpoint 
)
protected

Creates http request with method params from query and with url equals endpoint.

Author
Alexey Kiselyov
Parameters
query- contains method params
endpoint- url of target service
Returns
http request for http-client
56  {
57 
58  try {
59  URIBuilder uriBuilder = new URIBuilder(endpoint);
60 
61  if (!HttpQuery.Method.POST.equals(query.getMethod())) {
62  for (Map.Entry<String, String> methodParam : query.getMethodParams().entrySet()) {
63  uriBuilder.setParameter(methodParam.getKey(), methodParam.getValue());
64  }
65  }
66 
67  return createMethod(query, uriBuilder.build());
68  } catch (Exception e) {
69  throw new RuntimeException(e);
70  }
71  }