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

    • messageId

      int messageId()
      Returns:
      The ID for this response which is identical to the ID on the corresponding request.
    • 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.
    • isStatusCodeClass

      boolean isStatusCodeClass(StatusCodeClass statusCodeClass)
      Test whether the status code is in the specified class.
      Specified by:
      isStatusCodeClass in interface HttpResponse
      Parameters:
      statusCodeClass - The class of status code to test.
      Returns:
      True if the status code is in the class.
    • 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 HttpMessage
      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.
    • hasHeader

      boolean hasHeader(HttpHeader header)
      Offset within the message where the message body begins.
      Specified by:
      hasHeader in interface HttpMessage
      Specified by:
      hasHeader in interface HttpResponse
      Parameters:
      header - The header to check if it exists in the request.
      Returns:
      The message body offset.
    • hasHeader

      boolean hasHeader(String name)
      Specified by:
      hasHeader in interface HttpMessage
      Specified by:
      hasHeader in interface HttpResponse
      Parameters:
      name - The name of the header to query within the request.
      Returns:
      True if a header exists in the request with the supplied name.
    • hasHeader

      boolean hasHeader(String name, String value)
      Specified by:
      hasHeader in interface HttpMessage
      Specified by:
      hasHeader in interface HttpResponse
      Parameters:
      name - The name of the header to check.
      value - The value of the header to check.
      Returns:
      True if a header exists in the request that matches the name and value supplied.
    • header

      HttpHeader header(String name)
      Specified by:
      header in interface HttpMessage
      Specified by:
      header in interface HttpResponse
      Parameters:
      name - The name of the header to retrieve.
      Returns:
      An instance of HttpHeader that matches the name supplied, null if no match found.
    • headerValue

      String headerValue(String name)
      Specified by:
      headerValue in interface HttpMessage
      Specified by:
      headerValue in interface HttpResponse
      Parameters:
      name - The name of the header to retrieve.
      Returns:
      The String value of the header that matches the name supplied, null if no match found.
    • 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.
    • cookie

      Cookie cookie(String name)
      Specified by:
      cookie in interface HttpResponse
      Parameters:
      name - The name of the cookie to find.
      Returns:
      An instance of Cookie that matches the name provided. null if not found.
    • cookieValue

      String cookieValue(String name)
      Specified by:
      cookieValue in interface HttpResponse
      Parameters:
      name - The name of the cookie to retrieve the value from.
      Returns:
      The value of the cookie that matches the name provided. null if not found.
    • hasCookie

      boolean hasCookie(String name)
      Specified by:
      hasCookie in interface HttpResponse
      Parameters:
      name - The name of the cookie to check if it exists in the response.
      Returns:
      true If a cookie exists within the response that matches the name provided. false if not.
    • hasCookie

      boolean hasCookie(Cookie cookie)
      Specified by:
      hasCookie in interface HttpResponse
      Parameters:
      cookie - An instance of Cookie to check if it exists in the response.
      Returns:
      true If a cookie exists within the response that matches the Cookie provided. false if not.
    • mimeType

      MimeType mimeType()
      Obtain the MIME type of the response, as determined by Burp Suite.
      Specified by:
      mimeType in interface HttpResponse
      Returns:
      The MIME type.
    • 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.
    • contains

      boolean contains(String searchTerm, boolean caseSensitive)
      Searches the data in the HTTP message for the specified search term.
      Specified by:
      contains in interface HttpMessage
      Specified by:
      contains in interface HttpResponse
      Parameters:
      searchTerm - The value to be searched for.
      caseSensitive - Flags whether the search is case-sensitive.
      Returns:
      True if the search term is found.
    • contains

      boolean contains(Pattern pattern)
      Searches the data in the HTTP message for the specified regular expression.
      Specified by:
      contains in interface HttpMessage
      Specified by:
      contains in interface HttpResponse
      Parameters:
      pattern - The regular expression to be searched for.
      Returns:
      True if the pattern is matched.
    • 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.