Package org.web3j.protocol.http
Class HttpService
java.lang.Object
org.web3j.protocol.Service
org.web3j.protocol.http.HttpService
- All Implemented Interfaces:
Web3jService
HTTP implementation of our services API.
-
Field Summary
FieldsFields inherited from class org.web3j.protocol.Service
objectMapper -
Constructor Summary
ConstructorsConstructorDescriptionHttpService(boolean includeRawResponse) HttpService(String url) HttpService(String url, boolean includeRawResponse) HttpService(String url, okhttp3.OkHttpClient httpClient) HttpService(String url, okhttp3.OkHttpClient httpClient, boolean includeRawResponses) HttpService(okhttp3.OkHttpClient httpClient) HttpService(okhttp3.OkHttpClient httpClient, boolean includeRawResponses) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddHeaders(Map<String, String> headersToAdd) voidclose()Closes resources used by the service.static okhttp3.OkHttpClient.BuildergetUrl()protected InputStreamprotected voidprocessHeaders(okhttp3.Headers headers)
-
Field Details
-
JSON_MEDIA_TYPE
public static final okhttp3.MediaType JSON_MEDIA_TYPE -
DEFAULT_URL
- See Also:
-
-
Constructor Details
-
HttpService
-
HttpService
public HttpService(okhttp3.OkHttpClient httpClient, boolean includeRawResponses) -
HttpService
-
HttpService
-
HttpService
-
HttpService
public HttpService(okhttp3.OkHttpClient httpClient) -
HttpService
public HttpService(boolean includeRawResponse) -
HttpService
public HttpService()
-
-
Method Details
-
getOkHttpClientBuilder
public static okhttp3.OkHttpClient.Builder getOkHttpClientBuilder() -
performIO
- Specified by:
performIOin classService- Throws:
IOException
-
processHeaders
protected void processHeaders(okhttp3.Headers headers) -
addHeader
-
addHeaders
-
getHeaders
-
getUrl
-
close
Description copied from interface:Web3jServiceCloses resources used by the service.- Throws:
IOException- thrown if a service failed to close all resources
-