-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Milestone
Description
Description
Similar to the configuration class from c#, it sould be possible to set the default headers for each HTTP request.
At the moment adding deafult header will cause duplicates, beacause there is no way to remove the previous header.
Swagger-codegen version
CodeGen version: 2.2.3
Swagger-codegen Java library
resttemplate
Suggest a fix/enhancement
fix duplicate problem:
public ApiClient addDefaultHeader(String name, String value) {
if(defaultHeaders.containsKey(name))
defaultHeaders.remove(name);
defaultHeaders.add(name, value);
return this;
}
or add something like
public void setDefaultHeader(HttpHeaders headers){
defaultHeaders = headers;
}