StagingConnection connection = localServer.getConnection(settings.getUrl());
// Propagate web request settings to the local connection.
for (NameValuePair param : settings.getRequestParameters()) {
connection.addRequestParameter(param.getName(), param.getValue());
}
HttpMethod httpMethod = HttpMethod.valueOf(settings.getHttpMethod().toString());
connection.setRequestMethod(httpMethod);
connection.setRequestCharacterEncoding(settings.getCharset());
String body = settings.getRequestBody();
String contentType = settings.getEncodingType().getName();
connection.setRequestBody(body);