public class AS2HttpClient extends Object
| Constructor and Description |
|---|
AS2HttpClient(String sUrl,
org.apache.hc.core5.util.Timeout aConnectTimeout,
org.apache.hc.core5.util.Timeout aResponseTimeout,
com.helger.commons.http.EHttpMethod eRequestMethod,
Proxy aProxy,
SSLContext aSSLContext,
HostnameVerifier aHV) |
| Modifier and Type | Method and Description |
|---|---|
void |
disconnect()
Close the connection
|
InputStream |
getInputStream()
Get InputStream
|
int |
getResponseCode() |
com.helger.commons.http.HttpHeaderMap |
getResponseHeaderFields() |
String |
getResponseMessage() |
URL |
getURL() |
static boolean |
isErrorResponseCode(int nResponseCode)
This method determines if something is an HTTP error or not.
|
long |
send(InputStream aISToSend,
com.helger.mail.cte.EContentTransferEncoding eCTE,
IHTTPOutgoingDumper aOutgoingDumper,
AS2ResourceHelper aResHelper) |
void |
setHttpHeader(String sName,
String sValue)
Set an HTTP header (replacing existing value).
|
public AS2HttpClient(@Nonnull @Nonempty String sUrl, @Nonnull org.apache.hc.core5.util.Timeout aConnectTimeout, @Nonnull org.apache.hc.core5.util.Timeout aResponseTimeout, @Nonnull com.helger.commons.http.EHttpMethod eRequestMethod, @Nullable Proxy aProxy, @Nullable SSLContext aSSLContext, @Nullable HostnameVerifier aHV)
public void setHttpHeader(@Nonnull String sName, @Nonnull String sValue)
sName - Header name. May not be null.sValue - Header value. May not be null.@Nonnull public URL getURL() throws AS2Exception
null.AS2Exception - in case of error (e.g. if the URI could not be converted to a URL).@Nonnegative public long send(@Nonnull InputStream aISToSend, @Nullable com.helger.mail.cte.EContentTransferEncoding eCTE, @Nullable IHTTPOutgoingDumper aOutgoingDumper, @Nonnull AS2ResourceHelper aResHelper) throws IOException
aISToSend - InputStream to send. May not be null.eCTE - Content-Transfer-Encoding to be used. May not be null.aOutgoingDumper - Optional outgoing dumperaResHelper - Resource helperIOException - In case of errorpublic InputStream getInputStream() throws AS2Exception, IOException
AS2Exception - in case of errorIOException - in case of IO errorpublic int getResponseCode()
throws AS2Exception
AS2Exception - in case of errorpublic String getResponseMessage() throws AS2Exception
AS2Exception - in case of error@Nonnull @ReturnsMutableCopy public com.helger.commons.http.HttpHeaderMap getResponseHeaderFields() throws AS2Exception
AS2Exceptionpublic void disconnect()
public static boolean isErrorResponseCode(int nResponseCode)
nResponseCode - The HTTP status code to check.true if it is an error, false on success.Copyright © 2013–2022 Philip Helger. All rights reserved.