Class HttpService

java.lang.Object
org.web3j.protocol.Service
org.web3j.protocol.http.HttpService
All Implemented Interfaces:
Web3jService

public class HttpService extends Service
HTTP implementation of our services API.
  • Field Details

    • JSON_MEDIA_TYPE

      public static final okhttp3.MediaType JSON_MEDIA_TYPE
    • DEFAULT_URL

      public static final String DEFAULT_URL
      See Also:
  • Constructor Details

    • HttpService

      public HttpService(String url, okhttp3.OkHttpClient httpClient, boolean includeRawResponses)
    • HttpService

      public HttpService(okhttp3.OkHttpClient httpClient, boolean includeRawResponses)
    • HttpService

      public HttpService(String url, okhttp3.OkHttpClient httpClient)
    • HttpService

      public HttpService(String url)
    • HttpService

      public HttpService(String url, boolean includeRawResponse)
    • HttpService

      public HttpService(okhttp3.OkHttpClient httpClient)
    • HttpService

      public HttpService(boolean includeRawResponse)
    • HttpService

      public HttpService()
  • Method Details

    • getOkHttpClientBuilder

      public static okhttp3.OkHttpClient.Builder getOkHttpClientBuilder()
    • performIO

      protected InputStream performIO(String request) throws IOException
      Specified by:
      performIO in class Service
      Throws:
      IOException
    • processHeaders

      protected void processHeaders(okhttp3.Headers headers)
    • addHeader

      public void addHeader(String key, String value)
    • addHeaders

      public void addHeaders(Map<String,String> headersToAdd)
    • getHeaders

      public HashMap<String,String> getHeaders()
    • getUrl

      public String getUrl()
    • close

      public void close() throws IOException
      Description copied from interface: Web3jService
      Closes resources used by the service.
      Throws:
      IOException - thrown if a service failed to close all resources