Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public class ApiClient {
protected Map<String, String> defaultHeaderMap = new HashMap<String, String>();
protected Map<String, String> defaultCookieMap = new HashMap<String, String>();
protected String basePath = "{{{basePath}}}";
protected String userAgent;
private static final Logger log = Logger.getLogger(ApiClient.class.getName());

protected List<ServerConfiguration> servers = new ArrayList<ServerConfiguration>({{#servers}}{{#-first}}Arrays.asList(
Expand Down Expand Up @@ -521,10 +522,19 @@ public class ApiClient {
* @return API client
*/
public ApiClient setUserAgent(String userAgent) {
userAgent = userAgent;
addDefaultHeader("User-Agent", userAgent);
return this;
}

/**
* Get the User-Agent header's value.
* @return User-Agent string
*/
public String getUserAgent(){
return userAgent;
}

/**
* Add a default header.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public class ApiClient {
protected Map<String, String> defaultHeaderMap = new HashMap<String, String>();
protected Map<String, String> defaultCookieMap = new HashMap<String, String>();
protected String basePath = "http://petstore.swagger.io:80/v2";
protected String userAgent;
private static final Logger log = Logger.getLogger(ApiClient.class.getName());

protected List<ServerConfiguration> servers = new ArrayList<ServerConfiguration>(Arrays.asList(
Expand Down Expand Up @@ -517,10 +518,19 @@ public ApiClient setOauthScope(String scope) {
* @return API client
*/
public ApiClient setUserAgent(String userAgent) {
userAgent = userAgent;
addDefaultHeader("User-Agent", userAgent);
return this;
}

/**
* Get the User-Agent header's value.
* @return User-Agent string
*/
public String getUserAgent(){
return userAgent;
}

/**
* Add a default header.
*
Expand Down