Package org.deltafi.common.http
Class HttpService
java.lang.Object
org.deltafi.common.http.HttpService
General purpose HTTP client service
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionPost data to an HTTP endpoint
-
Constructor Details
-
HttpService
public HttpService()
-
-
Method Details
-
post
@NotNull public HttpResponse<InputStream> post(@NotNull String url, @NotNull Map<String, String> headers, @NotNull InputStream body, @NotNull String mediaType) throws HttpPostExceptionPost data to an HTTP endpoint- Parameters:
url- URL endpoint where data will be postedheaders- Map of key-value pairs for HTTP header fields and valuesbody- Body content to be posted to the HTTP endpointmediaType- Media type of the HTTP post- Returns:
- an HTTP response object with success/failure details
- Throws:
HttpPostException- when the HTTP client throws an IOException, InterruptedException, IllegalArgumentException , or SecurityException
-