Skip to content

Commit 08f1e95

Browse files
committed
Updated okhttp dependency
1 parent 43e1d24 commit 08f1e95

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
<dependency>
134134
<groupId>com.squareup.okhttp3</groupId>
135135
<artifactId>okhttp</artifactId>
136-
<version>3.13.1</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)