Package org.deltafi.common.http
Class HttpService
- java.lang.Object
-
- org.deltafi.common.http.HttpService
-
public class HttpService extends java.lang.ObjectGeneral purpose HTTP client service
-
-
Constructor Summary
Constructors Constructor Description HttpService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.http.HttpResponse<java.io.InputStream>post(java.lang.String url, java.util.Map<java.lang.String,java.lang.String> headers, java.io.InputStream body, java.lang.String mediaType)Post data to an HTTP endpoint
-
-
-
Method Detail
-
post
@NotNull public java.net.http.HttpResponse<java.io.InputStream> post(@NotNull java.lang.String url, @NotNull java.util.Map<java.lang.String,java.lang.String> headers, @NotNull java.io.InputStream body, @NotNull java.lang.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
-
-