if (useUrlEncodedContentType && entry.getKey().toLowerCase().equals("content-type")) {
continue;
}
for (String value : entry.getValue()) {
Header header = addRequest.addHeader();
header.setKey(entry.getKey());
header.setValue(value);
}
}
if (useUrlEncodedContentType) {
Header contentTypeHeader = addRequest.addHeader();
contentTypeHeader.setKey("content-type");
contentTypeHeader.setValue("application/x-www-form-urlencoded");
}
if (tag != null) {
if (method != TaskOptions.Method.PULL) {
throw new IllegalArgumentException("Only PULL tasks can have a tag.");