Interface HttpRequestResponse


public interface HttpRequestResponse
This interface is used to define a coupling between HttpRequest and HttpResponse.
  • Method Details

    • request

      HttpRequest request()
      Returns:
      The HTTP request message.
    • response

      HttpResponse response()
      Returns:
      The HTTP response message.
    • annotations

      Annotations annotations()
      Returns:
      The annotations.
    • url

      String url()
      Retrieve the URL for the request.
      If the request is malformed, then a MalformedRequestException is thrown.
      Returns:
      The URL in the request.
      Throws:
      MalformedRequestException - if request is malformed.
    • httpService

      HttpService httpService()
      HTTP service for the request.
      Returns:
      An HttpService object containing details of the HTTP service.
    • contentType

      ContentType contentType()
      Returns:
      The detected content type of the request.
    • statusCode

      short statusCode()
      HTTP status code contained in the response.
      Returns:
      HTTP status code or -1 if there is no response.
    • requestMarkers

      List<Marker> requestMarkers()
      Returns:
      List of request markers
    • responseMarkers

      List<Marker> responseMarkers()
      Returns:
      List of response markers
    • copyToTempFile

      HttpRequestResponse copyToTempFile()
      Create a copy of the HttpRequestResponse in temporary file.
      This method is used to save the HttpRequestResponse object to a temporary file, so that it is no longer held in memory. Extensions can use this method to convert HttpRequest objects into a form suitable for long-term usage.
      Returns:
      A new ByteArray instance stored in temporary file.
    • withAnnotations

      HttpRequestResponse withAnnotations(Annotations annotations)
      Create a copy of the HttpRequestResponse with the added annotations.
      Parameters:
      annotations - annotations to add.
      Returns:
      A new HttpRequestResponse instance.
    • withRequestMarkers

      HttpRequestResponse withRequestMarkers(List<Marker> requestMarkers)
      Create a copy of the HttpRequestResponse with the added request markers.
      Parameters:
      requestMarkers - Request markers to add.
      Returns:
      A new HttpRequestResponse instance.
    • withRequestMarkers

      HttpRequestResponse withRequestMarkers(Marker... requestMarkers)
      Create a copy of the HttpRequestResponse with the added request markers.
      Parameters:
      requestMarkers - Request markers to add.
      Returns:
      A new HttpRequestResponse instance.
    • withResponseMarkers

      HttpRequestResponse withResponseMarkers(List<Marker> responseMarkers)
      Create a copy of the HttpRequestResponse with the added response markers.
      Parameters:
      responseMarkers - Response markers to add.
      Returns:
      A new HttpRequestResponse instance.
    • withResponseMarkers

      HttpRequestResponse withResponseMarkers(Marker... responseMarkers)
      Create a copy of the HttpRequestResponse with the added response markers.
      Parameters:
      responseMarkers - Response markers to add.
      Returns:
      A new HttpRequestResponse instance.
    • httpRequestResponse

      static HttpRequestResponse httpRequestResponse(HttpRequest request, HttpResponse response)
      Create a new instance of HttpRequestResponse.
      Parameters:
      request - The HTTP request.
      response - The HTTP response.
      Returns:
      A new HttpRequestResponse instance.
    • httpRequestResponse

      static HttpRequestResponse httpRequestResponse(HttpRequest httpRequest, HttpResponse httpResponse, Annotations annotations)
      Create a new instance of HttpRequestResponse.
      Parameters:
      httpRequest - The HTTP request.
      httpResponse - The HTTP response.
      annotations - annotations.
      Returns:
      A new HttpRequestResponse instance.