Package ai.freeplay.client.internal
Class HttpUtil
- java.lang.Object
-
- ai.freeplay.client.internal.HttpUtil
-
public class HttpUtil extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description HttpUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.net.http.HttpResponse<java.lang.String>get(java.lang.String url, java.lang.String apiKey)static java.util.Map<java.lang.String,java.lang.Object>parseBody(java.net.http.HttpResponse<java.lang.String> response)static java.net.http.HttpResponse<java.lang.String>postJsonWithBearer(java.lang.String url, java.lang.String body, java.lang.String apiKey)static java.net.http.HttpResponse<java.lang.String>postJsonWithBearer(java.lang.String url, java.util.Map<java.lang.String,java.lang.Object> body, java.lang.String apiKey)static java.net.http.HttpResponse<java.lang.String>postWithBearer(java.lang.String url, java.lang.String apiKey)static voidthrowIfError(java.net.http.HttpResponse<java.lang.String> response, int expectedStatus)
-
-
-
Method Detail
-
postWithBearer
public static java.net.http.HttpResponse<java.lang.String> postWithBearer(java.lang.String url, java.lang.String apiKey) throws FreeplayException- Throws:
FreeplayException
-
postJsonWithBearer
public static java.net.http.HttpResponse<java.lang.String> postJsonWithBearer(java.lang.String url, java.util.Map<java.lang.String,java.lang.Object> body, java.lang.String apiKey) throws FreeplayException- Throws:
FreeplayException
-
postJsonWithBearer
public static java.net.http.HttpResponse<java.lang.String> postJsonWithBearer(java.lang.String url, java.lang.String body, java.lang.String apiKey) throws FreeplayException- Throws:
FreeplayException
-
get
public static java.net.http.HttpResponse<java.lang.String> get(java.lang.String url, java.lang.String apiKey) throws FreeplayException- Throws:
FreeplayException
-
parseBody
public static java.util.Map<java.lang.String,java.lang.Object> parseBody(java.net.http.HttpResponse<java.lang.String> response) throws FreeplayException- Throws:
FreeplayException
-
throwIfError
public static void throwIfError(java.net.http.HttpResponse<java.lang.String> response, int expectedStatus) throws FreeplayException- Throws:
FreeplayException
-
-