Package burp.api.montoya.proxy.http
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.cookies()Obtain details of the HTTP cookies set in the response.This method retrieves the IP address for the destination of the intercepted message.headers()HTTP headers contained in the message.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.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.Obtain the HTTP reason phrase contained in the response for HTTP 1 messages.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.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, toString
-
Method Details
-
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.
-
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 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.
-
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.
-
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.
-
toByteArray
ByteArray toByteArray()Message as a byte array.- Specified by:
toByteArrayin interfaceHttpMessage- Specified by:
toByteArrayin interfaceHttpResponse- Returns:
- The message as a byte array.
-
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.
-