Package com.slack.api.util.http
Class SlackHttpClient
java.lang.Object
com.slack.api.util.http.SlackHttpClient
- All Implemented Interfaces:
AutoCloseable
The Slack API HTTP Client.
-
Constructor Summary
ConstructorsConstructorDescriptionSlackHttpClient(SlackConfig config, Map<String, String> userAgentCustomInfo) SlackHttpClient(Map<String, String> userAgentCustomInfo) SlackHttpClient(okhttp3.OkHttpClient okHttpClient) -
Method Summary
Modifier and TypeMethodDescriptionstatic okhttp3.OkHttpClientbuildOkHttpClient(SlackConfig config) static okhttp3.OkHttpClientbuildOkHttpClient(SlackConfig config, Map<String, String> userAgentCustomInfo) static SlackHttpClientbuildSlackHttpClient(SlackConfig config) static SlackHttpClientbuildSlackHttpClient(SlackConfig config, Map<String, String> userAgentCustomInfo) voidclose()okhttp3.Responsedelete(okhttp3.Request.Builder requestBuilder) okhttp3.Responseokhttp3.ResponsepatchCamelCaseJsonBodyWithBearerHeader(String url, String token, Object obj) okhttp3.ResponsepostCamelCaseJsonBodyWithBearerHeader(String url, String token, Object obj) okhttp3.Responseokhttp3.ResponsepostFormWithAuthorizationHeader(String url, String authorizationHeader, okhttp3.FormBody formBody) okhttp3.ResponsepostFormWithBearerHeader(String url, String token, okhttp3.FormBody formBody) okhttp3.ResponsepostJsonBody(String url, Object obj) okhttp3.ResponsepostMultipart(String url, String token, okhttp3.MultipartBody multipartBody) okhttp3.ResponseputCamelCaseJsonBodyWithBearerHeader(String url, String token, Object obj) voidrunHttpResponseListeners(okhttp3.Response response, String body) voidrunHttpResponseListeners(okhttp3.Response response, String body, boolean isRequestBodyBinary) voidsetConfig(SlackConfig config)
-
Constructor Details
-
SlackHttpClient
public SlackHttpClient() -
SlackHttpClient
-
SlackHttpClient
-
SlackHttpClient
public SlackHttpClient(okhttp3.OkHttpClient okHttpClient)
-
-
Method Details
-
buildSlackHttpClient
-
buildSlackHttpClient
public static SlackHttpClient buildSlackHttpClient(SlackConfig config, Map<String, String> userAgentCustomInfo) -
buildOkHttpClient
-
buildOkHttpClient
public static okhttp3.OkHttpClient buildOkHttpClient(SlackConfig config, Map<String, String> userAgentCustomInfo) -
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
getConfig
-
setConfig
-
get
- Throws:
IOException
-
postMultipart
public okhttp3.Response postMultipart(String url, String token, okhttp3.MultipartBody multipartBody) throws IOException - Throws:
IOException
-
postForm
- Throws:
IOException
-
postFormWithBearerHeader
public okhttp3.Response postFormWithBearerHeader(String url, String token, okhttp3.FormBody formBody) throws IOException - Throws:
IOException
-
postFormWithAuthorizationHeader
public okhttp3.Response postFormWithAuthorizationHeader(String url, String authorizationHeader, okhttp3.FormBody formBody) throws IOException - Throws:
IOException
-
postJsonBody
- Throws:
IOException
-
postCamelCaseJsonBodyWithBearerHeader
public okhttp3.Response postCamelCaseJsonBodyWithBearerHeader(String url, String token, Object obj) throws IOException - Throws:
IOException
-
patchCamelCaseJsonBodyWithBearerHeader
public okhttp3.Response patchCamelCaseJsonBodyWithBearerHeader(String url, String token, Object obj) throws IOException - Throws:
IOException
-
putCamelCaseJsonBodyWithBearerHeader
public okhttp3.Response putCamelCaseJsonBodyWithBearerHeader(String url, String token, Object obj) throws IOException - Throws:
IOException
-
delete
- Throws:
IOException
-
runHttpResponseListeners
-
runHttpResponseListeners
public void runHttpResponseListeners(okhttp3.Response response, String body, boolean isRequestBodyBinary)
-