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