Skip to content

Commit

Permalink
Add Custom Agent to Requests Header
Browse files Browse the repository at this point in the history
  • Loading branch information
r4m-juan committed Jan 20, 2023
1 parent fbc94a1 commit 644f3eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.route4me</groupId>
<artifactId>route4me-java-sdk</artifactId>
<version>1.14.2</version>
<version>1.14.3</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/route4me/sdk/Manager.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ private <T> T makeRequest(RequestMethod method, URIBuilder builder, HttpEntity b
builder.addParameter("api_key", this.apiKey);
}
HttpRequestBase hrb = method.create(builder.build());
// Adding User-Agent
hrb.setHeader("User-Agent", "Route4Me Java SDK");

if (requestContentType != null) {
hrb.setHeader("Content-type", requestContentType);
}
Expand Down

0 comments on commit 644f3eb

Please sign in to comment.