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 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

      public static SlackHttpClient buildSlackHttpClient​(SlackConfig config)
    • buildSlackHttpClient

      public static SlackHttpClient buildSlackHttpClient​(SlackConfig config, java.util.Map<java.lang.String,​java.lang.String> userAgentCustomInfo)
    • buildOkHttpClient

      public static okhttp3.OkHttpClient buildOkHttpClient​(SlackConfig config)
    • 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:
      close in interface java.lang.AutoCloseable
      Throws:
      java.lang.Exception
    • getConfig

      public SlackConfig getConfig()
    • setConfig

      public void setConfig​(SlackConfig config)
    • 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)