11package com .securenative .http ;
22
33import com .securenative .config .SecureNativeOptions ;
4- import com .securenative .exceptions .SecureNativeInvalidUriException ;
5- import com .securenative .http .HttpClient ;
6- import com .securenative .http .HttpResponse ;
74import com .securenative .utils .VersionUtils ;
85import 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