this.gson = gson;
}
public void send(HttpURLConnection conn, WebServiceRequest request) {
try {
HttpMethod method = request.getHttpMethod();
if (SIMULATE_POST_WITH_PUT && method == HttpMethod.PUT) {
method = HttpMethod.POST;
setHeader(conn, HttpMethod.SIMULATED_METHOD_HEADER, HttpMethod.PUT.toString(), true);
}
if (LogConfig.INFO) logger.info(method + " to " + conn.getURL());
conn.setRequestMethod(method.toString());
// Assume conservatively that the response will need to be read.
// This is done here instead of in the response receiver because this property must be set
// before sending any data on the connection.
conn.setDoInput(true);
setHeader(conn, "Accept", request.getContentType(), true);