public interface CrtHttpStreamHandler
Modifier and Type | Method and Description |
---|---|
default int |
onResponseBody(HttpStream stream,
ByteBuffer bodyBytesIn)
Called when new Response Body bytes have been received.
|
void |
onResponseComplete(HttpStream stream,
int errorCode)
Called from Native when the Response has completed.
|
void |
onResponseHeaders(HttpStream stream,
int responseStatusCode,
HttpHeader[] nextHeaders)
Called from Native when new Http Headers have been received.
|
default void |
onResponseHeadersDone(HttpStream stream,
boolean hasBody)
Called from Native once all HTTP Headers are processed.
|
default boolean |
sendRequestBody(HttpStream stream,
ByteBuffer bodyBytesOut)
Called from Native when the Http Request has a Body (Eg PUT/POST requests).
|
void onResponseHeaders(HttpStream stream, int responseStatusCode, HttpHeader[] nextHeaders)
stream
- The HttpStream objectresponseStatusCode
- The HTTP Response Status CodenextHeaders
- The headers received in the latest IO event.default void onResponseHeadersDone(HttpStream stream, boolean hasBody)
stream
- The HttpStream objecthasBody
- True if the HTTP Response had a Body, false otherwise.default int onResponseBody(HttpStream stream, ByteBuffer bodyBytesIn)
bodyBytesIn
- The HTTP Body Bytes received in the last IO Event. The user MUST either copy all bytes from
this Buffer, since there will not be another chance to read this data.void onResponseComplete(HttpStream stream, int errorCode)
stream
- errorCode
- default boolean sendRequestBody(HttpStream stream, ByteBuffer bodyBytesOut)
stream
- The HttpStream for this Request/Response PairbodyBytesOut
- The Buffer to write the Request Body Bytes to.Copyright © 2019. All rights reserved.