Skip to content

Commit 2e3da4b

Browse files
authored
Merge pull request #23 from securenative/dev
Dev
2 parents 430fa64 + 08f1e95 commit 2e3da4b

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<groupId>com.securenative.java</groupId>
77
<artifactId>securenative-java</artifactId>
88
<packaging>jar</packaging>
9-
<version>0.3.7</version>
9+
<version>0.4.2</version>
1010
<url>https://github.com/securenative/securenative-java</url>
1111

1212
<name>${project.groupId}:${project.artifactId}:${project.version}</name>
@@ -130,10 +130,10 @@
130130
<artifactId>slf4j-api</artifactId>
131131
<version>1.7.12</version>
132132
</dependency>
133-
<dependency>
133+
<dependency>
134134
<groupId>com.squareup.okhttp3</groupId>
135135
<artifactId>okhttp</artifactId>
136-
<version>4.0.0</version>
136+
<version>4.1.0</version>
137137
</dependency>
138138
<dependency>
139139
<groupId>org.mockito</groupId>

src/main/java/com/securenative/http/SecureNativeHTTPClient.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
package com.securenative.http;
22

33
import com.securenative.config.SecureNativeOptions;
4-
import com.securenative.exceptions.SecureNativeInvalidUriException;
5-
import com.securenative.http.HttpClient;
6-
import com.securenative.http.HttpResponse;
74
import com.securenative.utils.VersionUtils;
85
import okhttp3.*;
96

@@ -18,7 +15,7 @@ public class SecureNativeHTTPClient implements HttpClient {
1815
private final String USER_AGENT_HEADER_VALUE = "SecureNative-java";
1916
private final OkHttpClient client;
2017
private final SecureNativeOptions options;
21-
public static final MediaType JSON = MediaType.get("application/json; charset=utf-8");
18+
public static final MediaType JSON_MEDIA_TYPE = MediaType.get("application/json; charset=utf-8");
2219

2320
public SecureNativeHTTPClient(SecureNativeOptions options) {
2421
this.options = options;
@@ -38,9 +35,9 @@ public SecureNativeHTTPClient(SecureNativeOptions options) {
3835

3936

4037
@Override
41-
public HttpResponse post(String path, String json) throws IOException {
42-
RequestBody body = RequestBody.create(json, JSON);
43-
38+
public HttpResponse post(String path, String payload) throws IOException {
39+
RequestBody body = RequestBody.create(payload, JSON_MEDIA_TYPE);
40+
4441
String url = String.format("%s/%s", this.options.getApiUrl(), path);
4542

4643
Request request = new Request.Builder()

0 commit comments

Comments
 (0)