Interface InterceptedResponse
- All Superinterfaces:
HttpMessage,HttpResponse,InterceptedHttpMessage
HTTP response intercepted by Burp Proxy.
-
Method Summary
Modifier and TypeMethodDescriptionattributes(AttributeType... types) Retrieve the values of response attributes.body()Body of a message as a byte array.intOffset within the message where the message body begins.Body of a message as aString.booleanSearches the data in the HTTP message for the specified search term.booleanSearches the data in the HTTP message for the specified regular expression.cookies()Obtain details of the HTTP cookies set in the response.cookieValue(String name) This method retrieves the IP address for the destination of the intercepted message.booleanbooleanbooleanhasHeader(HttpHeader header) Offset within the message where the message body begins.booleanbooleanheaders()HTTP headers contained in the message.headerValue(String name) Return the HTTP Version text parsed from the response line for HTTP 1 messages.Obtain the MIME type of the response, as inferred from the contents of the HTTP message body.booleanisStatusCodeClass(StatusCodeClass statusCodeClass) Test whether the status code is in the specified class.keywordCounts(String... keywords) Retrieve the number of types given keywords appear in the response.This method retrieves the name of the Burp Proxy listener that is processing the intercepted message.markers()Markers for the message.intThis method retrieves a unique ID for this request/response.mimeType()Obtain the MIME type of the response, as determined by Burp Suite.Obtain the HTTP reason phrase contained in the response for HTTP 1 messages.request()This method retrieves the IP address for the source of the intercepted message.Obtain the MIME type of the response, as stated in the HTTP headers.shortObtain the HTTP status code contained in the response.Message as a byte array.toString()Message as aString.withAddedHeader(HttpHeader header) Create a copy of theHttpResponsewith the added header.withAddedHeader(String name, String value) Create a copy of theHttpResponsewith the added header.Create a copy of theHttpResponsewith the updated body.
Updates Content-Length header.Create a copy of theHttpResponsewith the updated body.
Updates Content-Length header.withHttpVersion(String httpVersion) Create a copy of theHttpResponsewith the new http version.withMarkers(Marker... markers) Create a copy of theHttpResponsewith the added markers.withMarkers(List<Marker> markers) Create a copy of theHttpResponsewith the added markers.withReasonPhrase(String reasonPhrase) Create a copy of theHttpResponsewith the new reason phrase.withRemovedHeader(HttpHeader header) Create a copy of theHttpResponsewith the removed header.withRemovedHeader(String name) Create a copy of theHttpResponsewith the removed header.withStatusCode(short statusCode) Create a copy of theHttpResponsewith the provided status code.withUpdatedHeader(HttpHeader header) Create a copy of theHttpResponsewith the updated header.withUpdatedHeader(String name, String value) Create a copy of theHttpResponsewith the updated header.Methods inherited from interface burp.api.montoya.http.message.responses.HttpResponse
copyToTempFile, withAddedHeaders, withAddedHeaders, withRemovedHeaders, withRemovedHeaders, withUpdatedHeaders, withUpdatedHeaders
-
Method Details
-
request
HttpRequest request()- Returns:
- initiatingRequest The HTTP request that was sent.
- See Also:
-
initiatingRequest
HttpRequest initiatingRequest()- Returns:
- initiatingRequest The HTTP request that was sent.
-
annotations
Annotations annotations()- Returns:
- Annotations for request/response.
-
statusCode
short statusCode()Obtain the HTTP status code contained in the response.- Specified by:
statusCodein interfaceHttpResponse- 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:
reasonPhrasein interfaceHttpResponse- Returns:
- HTTP Reason phrase.
-
isStatusCodeClass
Test whether the status code is in the specified class.- Specified by:
isStatusCodeClassin interfaceHttpResponse- 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:
httpVersionin interfaceHttpMessage- Specified by:
httpVersionin interfaceHttpResponse- Returns:
- Version string
-
headers
List<HttpHeader> headers()HTTP headers contained in the message.- Specified by:
headersin interfaceHttpMessage- Specified by:
headersin interfaceHttpResponse- Returns:
- A list of HTTP headers.
-
hasHeader
Offset within the message where the message body begins.- Specified by:
hasHeaderin interfaceHttpMessage- Specified by:
hasHeaderin interfaceHttpResponse- Parameters:
header- The header to check if it exists in the request.- Returns:
- The message body offset.
-
hasHeader
- Specified by:
hasHeaderin interfaceHttpMessage- Specified by:
hasHeaderin interfaceHttpResponse- 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
- Specified by:
hasHeaderin interfaceHttpMessage- Specified by:
hasHeaderin interfaceHttpResponse- 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
- Specified by:
headerin interfaceHttpMessage- Specified by:
headerin interfaceHttpResponse- Parameters:
name- The name of the header to retrieve.- Returns:
- An instance of
HttpHeaderthat matches the name supplied,nullif no match found.
-
headerValue
- Specified by:
headerValuein interfaceHttpMessage- Specified by:
headerValuein interfaceHttpResponse- Parameters:
name- The name of the header to retrieve.- Returns:
- The
Stringvalue of the header that matches the name supplied,nullif no match found.
-
body
ByteArray body()Body of a message as a byte array.- Specified by:
bodyin interfaceHttpMessage- Specified by:
bodyin interfaceHttpResponse- Returns:
- The body of a message as a byte array.
-
bodyToString
String bodyToString()Body of a message as aString.- Specified by:
bodyToStringin interfaceHttpMessage- Specified by:
bodyToStringin interfaceHttpResponse- Returns:
- The body of a message as a
String.
-
bodyOffset
int bodyOffset()Offset within the message where the message body begins.- Specified by:
bodyOffsetin interfaceHttpMessage- Specified by:
bodyOffsetin interfaceHttpResponse- Returns:
- The message body offset.
-
markers
Markers for the message.- Specified by:
markersin interfaceHttpMessage- Specified by:
markersin interfaceHttpResponse- Returns:
- A list of markers.
-
cookies
Obtain details of the HTTP cookies set in the response.- Specified by:
cookiesin interfaceHttpResponse- Returns:
- A list of
Cookieobjects representing the cookies set in the response, if any.
-
cookie
- Specified by:
cookiein interfaceHttpResponse- Parameters:
name- The name of the cookie to find.- Returns:
- An instance of
Cookiethat matches the name provided.nullif not found.
-
cookieValue
- Specified by:
cookieValuein interfaceHttpResponse- Parameters:
name- The name of the cookie to retrieve the value from.- Returns:
- The value of the cookie that matches the name provided.
nullif not found.
-
hasCookie
- Specified by:
hasCookiein interfaceHttpResponse- Parameters:
name- The name of the cookie to check if it exists in the response.- Returns:
trueIf a cookie exists within the response that matches the name provided.falseif not.
-
hasCookie
- Specified by:
hasCookiein interfaceHttpResponse- Parameters:
cookie- An instance ofCookieto check if it exists in the response.- Returns:
trueIf a cookie exists within the response that matches theCookieprovided.falseif not.
-
mimeType
MimeType mimeType()Obtain the MIME type of the response, as determined by Burp Suite.- Specified by:
mimeTypein interfaceHttpResponse- Returns:
- The MIME type.
-
statedMimeType
MimeType statedMimeType()Obtain the MIME type of the response, as stated in the HTTP headers.- Specified by:
statedMimeTypein interfaceHttpResponse- 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:
inferredMimeTypein interfaceHttpResponse- Returns:
- The inferred MIME type.
-
keywordCounts
Retrieve the number of types given keywords appear in the response.- Specified by:
keywordCountsin interfaceHttpResponse- Parameters:
keywords- Keywords to count.- Returns:
- List of keyword counts in the order they were provided.
-
attributes
Retrieve the values of response attributes.- Specified by:
attributesin interfaceHttpResponse- Parameters:
types- Response attributes to retrieve values for.- Returns:
- List of
Attributeobjects.
-
contains
Searches the data in the HTTP message for the specified search term.- Specified by:
containsin interfaceHttpMessage- Specified by:
containsin interfaceHttpResponse- 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
Searches the data in the HTTP message for the specified regular expression.- Specified by:
containsin interfaceHttpMessage- Specified by:
containsin interfaceHttpResponse- 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:
toByteArrayin interfaceHttpMessage- Specified by:
toByteArrayin interfaceHttpResponse- Returns:
- The message as a byte array.
-
toString
String toString()Message as aString.- Specified by:
toStringin interfaceHttpMessage- Specified by:
toStringin interfaceHttpResponse- Overrides:
toStringin classObject- Returns:
- The message as a
String.
-
withStatusCode
Create a copy of theHttpResponsewith the provided status code.- Specified by:
withStatusCodein interfaceHttpResponse- Parameters:
statusCode- the new status code for response- Returns:
- A new
HttpResponseinstance.
-
withReasonPhrase
Create a copy of theHttpResponsewith the new reason phrase.- Specified by:
withReasonPhrasein interfaceHttpResponse- Parameters:
reasonPhrase- the new reason phrase for response- Returns:
- A new
HttpResponseinstance.
-
withHttpVersion
Create a copy of theHttpResponsewith the new http version.- Specified by:
withHttpVersionin interfaceHttpResponse- Parameters:
httpVersion- the new http version for response- Returns:
- A new
HttpResponseinstance.
-
withBody
Create a copy of theHttpResponsewith the updated body.
Updates Content-Length header.- Specified by:
withBodyin interfaceHttpResponse- Parameters:
body- the new body for the response- Returns:
- A new
HttpResponseinstance.
-
withBody
Create a copy of theHttpResponsewith the updated body.
Updates Content-Length header.- Specified by:
withBodyin interfaceHttpResponse- Parameters:
body- the new body for the response- Returns:
- A new
HttpResponseinstance.
-
withAddedHeader
Create a copy of theHttpResponsewith the added header.- Specified by:
withAddedHeaderin interfaceHttpResponse- Parameters:
header- TheHttpHeaderto add to the response.- Returns:
- The updated response containing the added header.
-
withAddedHeader
Create a copy of theHttpResponsewith the added header.- Specified by:
withAddedHeaderin interfaceHttpResponse- Parameters:
name- The name of the header.value- The value of the header.- Returns:
- The updated response containing the added header.
-
withUpdatedHeader
Create a copy of theHttpResponsewith the updated header.- Specified by:
withUpdatedHeaderin interfaceHttpResponse- Parameters:
header- TheHttpHeaderto update containing the new value.- Returns:
- The updated response containing the updated header.
-
withUpdatedHeader
Create a copy of theHttpResponsewith the updated header.- Specified by:
withUpdatedHeaderin interfaceHttpResponse- 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
Create a copy of theHttpResponsewith the removed header.- Specified by:
withRemovedHeaderin interfaceHttpResponse- Parameters:
header- TheHttpHeaderto remove from the response.- Returns:
- The updated response containing the removed header.
-
withRemovedHeader
Create a copy of theHttpResponsewith the removed header.- Specified by:
withRemovedHeaderin interfaceHttpResponse- Parameters:
name- The name of the HTTP header to remove from the response.- Returns:
- The updated response containing the removed header.
-
withMarkers
Create a copy of theHttpResponsewith the added markers.- Specified by:
withMarkersin interfaceHttpResponse- Parameters:
markers- Request markers to add.- Returns:
- A new
MarkedHttpRequestResponseinstance.
-
withMarkers
Create a copy of theHttpResponsewith the added markers.- Specified by:
withMarkersin interfaceHttpResponse- Parameters:
markers- Request markers to add.- Returns:
- A new
MarkedHttpRequestResponseinstance.
-
messageId
int messageId()This method retrieves a unique ID for this request/response.- Specified by:
messageIdin interfaceInterceptedHttpMessage- Returns:
- An identifier that is unique to a single request/response pair. Extensions can use this to correlate details of requests and responses and perform processing on the response message accordingly.
-
listenerInterface
String listenerInterface()This method retrieves the name of the Burp Proxy listener that is processing the intercepted message.- Specified by:
listenerInterfacein interfaceInterceptedHttpMessage- Returns:
- The name of the Burp Proxy listener that is processing the intercepted message. The format is the same as that shown in the Proxy Listeners UI - for example, "127.0.0.1:8080".
-
sourceIpAddress
InetAddress sourceIpAddress()This method retrieves the IP address for the source of the intercepted message.- Specified by:
sourceIpAddressin interfaceInterceptedHttpMessage- Returns:
- The IP address for the source of the intercepted message.
-
destinationIpAddress
InetAddress destinationIpAddress()This method retrieves the IP address for the destination of the intercepted message.- Specified by:
destinationIpAddressin interfaceInterceptedHttpMessage- Returns:
- The IP address for the destination of the intercepted message.
-