Interface HttpStreamResponseHandler


  • public interface HttpStreamResponseHandler
    Interface that Native code knows how to call when handling Http Responses for HTTP/1.1 only. You can use HttpStreamBaseResponseHandler instead to adapt both HTTP/1.1 and HTTP/2 Maps 1-1 to the Native Http API here: https://github.com/awslabs/aws-c-http/blob/master/include/aws/http/request_response.h
    • Method Detail

      • onResponseHeaders

        void onResponseHeaders​(HttpStream stream,
                               int responseStatusCode,
                               int blockType,
                               HttpHeader[] nextHeaders)
        Called from Native when new Http Headers have been received. Note that this function may be called multiple times as HTTP headers are received.
        Parameters:
        stream - The HttpStream object
        responseStatusCode - The HTTP Response Status Code
        blockType - The HTTP header block type
        nextHeaders - The headers received in the latest IO event.
      • onResponseHeadersDone

        default void onResponseHeadersDone​(HttpStream stream,
                                           int blockType)
        Called from Native once all HTTP Headers are processed. Will not be called if there are no Http Headers in the response. Guaranteed to be called exactly once if there is at least 1 Header.
        Parameters:
        stream - The HttpStream object
        blockType - The type of the header block, corresponds to HttpHeaderBlock
      • onMetrics

        default void onMetrics​(HttpStream stream,
                               HttpStreamMetrics metrics)
        Called right before stream is complete, whether successful or unsuccessful.
        Parameters:
        stream - The HTTP stream to which the metrics apply
        metrics - The [HttpStreamMetrics] containing metrics for the given stream
      • onResponseComplete

        void onResponseComplete​(HttpStream stream,
                                int errorCode)
        Called from Native when the Response has completed.
        Parameters:
        stream - completed stream
        errorCode - resultant errorCode for the response