Package com.helger.as2lib.util.http
Interface IAS2HttpResponseHandler
- All Known Implementing Classes:
AS2HttpResponseHandlerSocket
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Abstract HTTP response handler. This abstraction layer may be used to either
write to a socket directly or to e.g. send an HTTP response via a servlet.
- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptionvoid
sendHttpResponse
(int nHttpResponseCode, com.helger.commons.http.HttpHeaderMap aHeaders, com.helger.commons.io.IWriteToStream aData) Added an HTTP header to the response.
-
Method Details
-
sendHttpResponse
void sendHttpResponse(@Nonnegative int nHttpResponseCode, @Nonnull com.helger.commons.http.HttpHeaderMap aHeaders, @Nonnull @WillNotClose com.helger.commons.io.IWriteToStream aData) throws IOException Added an HTTP header to the response. This method must be called before any output is written.- Parameters:
nHttpResponseCode
- The HTTP response code. E.g. 200 for "HTTP OK". Must be > 0.aHeaders
- Headers to use. May not benull
.aData
- Data to send as response body. May not benull
but may be empty.- Throws:
IOException
- In case of error
-