public DeleteWithoutRedirectImpl(Gson gson) {
this.gson = gson;
}
public HttpDeleteWithBody createDeleteRequest(URI uri, Object payload) throws IOException {
HttpDeleteWithBody httpDelete = new HttpDeleteWithBody(uri);
HttpParams params = new BasicHttpParams();
params.setParameter(HANDLE_REDIRECTS, false);
httpDelete.setParams(params);
if (payload != null) {
String json = gson.toJson(payload);
StringEntity entity = new StringEntity(json, ENCODING);
entity.setContentType(ContentType.APPLICATION_JSON.getMimeType());
httpDelete.setEntity(entity);
}
return httpDelete;
}