Package burp.api.montoya.http.handler
Interface HttpResponseReceived
- All Superinterfaces:
HttpMessage,HttpResponse
Burp
HttpResponse with additional methods to retrieve initiating HttpRequest as well as the Annotations and ToolSource of the request.-
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.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.markers()Markers for the message.Obtain the HTTP reason phrase contained in the response for HTTP 1 messages.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
-
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:
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.
-
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.
-