Interface HttpResponseReceived

All Superinterfaces:
HttpMessage, HttpResponse

public interface HttpResponseReceived extends HttpResponse
Burp HttpResponse with additional methods to retrieve initiating HttpRequest as well as the Annotations and ToolSource of the request.
  • Method Details

    • initiatingRequest

      HttpRequest initiatingRequest()
      Returns:
      initiatingRequest The HTTP request that was sent.
    • annotations

      Annotations annotations()
      Returns:
      Annotations for request/response.
    • toolSource

      ToolSource toolSource()
      Returns:
      ToolSource which indicates which Burp tool sent the request.
    • statusCode

      short statusCode()
      Obtain the HTTP status code contained in the response.
      Specified by:
      statusCode in interface HttpResponse
      Returns:
      HTTP status code.
    • reasonPhrase

      String reasonPhrase()
      Obtain the HTTP reason phrase contained in the response for HTTP 1 messages. HTTP 2 messages will return a mapped phrase based on the status code.
      Specified by:
      reasonPhrase in interface HttpResponse
      Returns:
      HTTP Reason phrase.
    • httpVersion

      String httpVersion()
      Return the HTTP Version text parsed from the response line for HTTP 1 messages. HTTP 2 messages will return "HTTP/2"
      Specified by:
      httpVersion in interface HttpResponse
      Returns:
      Version string
    • headers

      List<HttpHeader> headers()
      HTTP headers contained in the message.
      Specified by:
      headers in interface HttpMessage
      Specified by:
      headers in interface HttpResponse
      Returns:
      A list of HTTP headers.
    • body

      ByteArray body()
      Body of a message as a byte array.
      Specified by:
      body in interface HttpMessage
      Specified by:
      body in interface HttpResponse
      Returns:
      The body of a message as a byte array.
    • bodyToString

      String bodyToString()
      Body of a message as a String.
      Specified by:
      bodyToString in interface HttpMessage
      Specified by:
      bodyToString in interface HttpResponse
      Returns:
      The body of a message as a String.
    • bodyOffset

      int bodyOffset()
      Offset within the message where the message body begins.
      Specified by:
      bodyOffset in interface HttpMessage
      Specified by:
      bodyOffset in interface HttpResponse
      Returns:
      The message body offset.
    • markers

      List<Marker> markers()
      Markers for the message.
      Specified by:
      markers in interface HttpMessage
      Specified by:
      markers in interface HttpResponse
      Returns:
      A list of markers.
    • cookies

      List<Cookie> cookies()
      Obtain details of the HTTP cookies set in the response.
      Specified by:
      cookies in interface HttpResponse
      Returns:
      A list of Cookie objects representing the cookies set in the response, if any.
    • statedMimeType

      MimeType statedMimeType()
      Obtain the MIME type of the response, as stated in the HTTP headers.
      Specified by:
      statedMimeType in interface HttpResponse
      Returns:
      The stated MIME type.
    • inferredMimeType

      MimeType inferredMimeType()
      Obtain the MIME type of the response, as inferred from the contents of the HTTP message body.
      Specified by:
      inferredMimeType in interface HttpResponse
      Returns:
      The inferred MIME type.
    • keywordCounts

      List<KeywordCount> keywordCounts(String... keywords)
      Retrieve the number of types given keywords appear in the response.
      Specified by:
      keywordCounts in interface HttpResponse
      Parameters:
      keywords - Keywords to count.
      Returns:
      List of keyword counts in the order they were provided.
    • attributes

      List<Attribute> attributes(AttributeType... types)
      Retrieve the values of response attributes.
      Specified by:
      attributes in interface HttpResponse
      Parameters:
      types - Response attributes to retrieve values for.
      Returns:
      List of Attribute objects.
    • toByteArray

      ByteArray toByteArray()
      Message as a byte array.
      Specified by:
      toByteArray in interface HttpMessage
      Specified by:
      toByteArray in interface HttpResponse
      Returns:
      The message as a byte array.
    • toString

      String toString()
      Message as a String.
      Specified by:
      toString in interface HttpMessage
      Specified by:
      toString in interface HttpResponse
      Overrides:
      toString in class Object
      Returns:
      The message as a String.
    • withStatusCode

      HttpResponse withStatusCode(short statusCode)
      Create a copy of the HttpResponse with the provided status code.
      Specified by:
      withStatusCode in interface HttpResponse
      Parameters:
      statusCode - the new status code for response
      Returns:
      A new HttpResponse instance.
    • withReasonPhrase

      HttpResponse withReasonPhrase(String reasonPhrase)
      Create a copy of the HttpResponse with the new reason phrase.
      Specified by:
      withReasonPhrase in interface HttpResponse
      Parameters:
      reasonPhrase - the new reason phrase for response
      Returns:
      A new HttpResponse instance.
    • withHttpVersion

      HttpResponse withHttpVersion(String httpVersion)
      Create a copy of the HttpResponse with the new http version.
      Specified by:
      withHttpVersion in interface HttpResponse
      Parameters:
      httpVersion - the new http version for response
      Returns:
      A new HttpResponse instance.
    • withBody

      HttpResponse withBody(String body)
      Create a copy of the HttpResponse with the updated body.
      Updates Content-Length header.
      Specified by:
      withBody in interface HttpResponse
      Parameters:
      body - the new body for the response
      Returns:
      A new HttpResponse instance.
    • withBody

      HttpResponse withBody(ByteArray body)
      Create a copy of the HttpResponse with the updated body.
      Updates Content-Length header.
      Specified by:
      withBody in interface HttpResponse
      Parameters:
      body - the new body for the response
      Returns:
      A new HttpResponse instance.
    • withAddedHeader

      HttpResponse withAddedHeader(HttpHeader header)
      Create a copy of the HttpResponse with the added header.
      Specified by:
      withAddedHeader in interface HttpResponse
      Parameters:
      header - The HttpHeader to add to the response.
      Returns:
      The updated response containing the added header.
    • withAddedHeader

      HttpResponse withAddedHeader(String name, String value)
      Create a copy of the HttpResponse with the added header.
      Specified by:
      withAddedHeader in interface HttpResponse
      Parameters:
      name - The name of the header.
      value - The value of the header.
      Returns:
      The updated response containing the added header.
    • withUpdatedHeader

      HttpResponse withUpdatedHeader(HttpHeader header)
      Create a copy of the HttpResponse with the updated header.
      Specified by:
      withUpdatedHeader in interface HttpResponse
      Parameters:
      header - The HttpHeader to update containing the new value.
      Returns:
      The updated response containing the updated header.
    • withUpdatedHeader

      HttpResponse withUpdatedHeader(String name, String value)
      Create a copy of the HttpResponse with the updated header.
      Specified by:
      withUpdatedHeader in interface HttpResponse
      Parameters:
      name - The name of the header to update the value of.
      value - The new value of the specified HTTP header.
      Returns:
      The updated response containing the updated header.
    • withRemovedHeader

      HttpResponse withRemovedHeader(HttpHeader header)
      Create a copy of the HttpResponse with the removed header.
      Specified by:
      withRemovedHeader in interface HttpResponse
      Parameters:
      header - The HttpHeader to remove from the response.
      Returns:
      The updated response containing the removed header.
    • withRemovedHeader

      HttpResponse withRemovedHeader(String name)
      Create a copy of the HttpResponse with the removed header.
      Specified by:
      withRemovedHeader in interface HttpResponse
      Parameters:
      name - The name of the HTTP header to remove from the response.
      Returns:
      The updated response containing the removed header.
    • withMarkers

      HttpResponse withMarkers(List<Marker> markers)
      Create a copy of the HttpResponse with the added markers.
      Specified by:
      withMarkers in interface HttpResponse
      Parameters:
      markers - Request markers to add.
      Returns:
      A new MarkedHttpRequestResponse instance.
    • withMarkers

      HttpResponse withMarkers(Marker... markers)
      Create a copy of the HttpResponse with the added markers.
      Specified by:
      withMarkers in interface HttpResponse
      Parameters:
      markers - Request markers to add.
      Returns:
      A new MarkedHttpRequestResponse instance.