I want to send http POST via my java client.
Is there a way to send query params and a content in the body for a POST request?
here is my java http client:
@Override
public ResponseOrError sendPost(String url, String bodyContent) {
url = urlUtils.getHttpUrl(url);
ResponseOrError responseOrError = new ResponseOrError();
final RetryListenerWithBooleanFlags listener = new RetryListenerWithBooleanFlags();
try {
HttpPost httpPost = new HttpPost(url);
httpPost.setConfig(requestConfig);
Callable<ResponseOrError> callable = getCallable(httpPost);
retryer = getRetryer(listener);
responseOrError = retryer.call(callable);
fillResponseOrError(responseOrError, listener);
} catch (Exception e) {
responseOrError.error = new Error();
String errorMsg = getStatusCode(responseOrError, listener);
responseOrError.error.errorMsg = e.getMessage() + errorMsg;
}
return responseOrError;
}