Interface HttpMessage

All Known Subinterfaces:
HttpRequest, HttpRequestToBeSent, HttpResponse, HttpResponseReceived, InterceptedRequest, InterceptedResponse

public interface HttpMessage
Burp message retrieve common information shared by HttpRequest and HttpResponse.
  • Method Details

    • hasHeader

      boolean hasHeader(HttpHeader header)
      Parameters:
      header - The header to check if it exists in the request.
      Returns:
      True if the header exists in the request.
    • hasHeader

      boolean hasHeader(String name)
      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)
      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)
      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)
      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.
    • headers

      List<HttpHeader> headers()
      HTTP headers contained in the message.
      Returns:
      A list of HTTP headers.
    • httpVersion

      String httpVersion()
      HTTP Version text parsed from the request or response line for HTTP 1 messages. HTTP 2 messages will return "HTTP/2"
      Returns:
      Version string
    • bodyOffset

      int bodyOffset()
      Offset within the message where the message body begins.
      Returns:
      The message body offset.
    • body

      ByteArray body()
      Body of a message as a byte array.
      Returns:
      The body of a message as a byte array.
    • bodyToString

      String bodyToString()
      Body of a message as a String.
      Returns:
      The body of a message as a String.
    • markers

      List<Marker> markers()
      Markers for the message.
      Returns:
      A list of markers.
    • contains

      boolean contains(String searchTerm, boolean caseSensitive)
      Searches the data in the HTTP message for the specified search term.
      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.
      Parameters:
      pattern - The regular expression to be searched for.
      Returns:
      True if the pattern is matched.
    • toByteArray

      ByteArray toByteArray()
      Message as a byte array.
      Returns:
      The message as a byte array.
    • toString

      String toString()
      Message as a String.
      Overrides:
      toString in class Object
      Returns:
      The message as a String.