Package burp.api.montoya.http.message
Interface HttpRequestResponse
public interface HttpRequestResponse
This interface is used to define a coupling between
HttpRequest
and HttpResponse
.-
Method Summary
Modifier and TypeMethodDescriptionboolean
Searches the data in the HTTP request, response and notes for the specified search term.boolean
Searches the data in the HTTP request, response and notes for the specified regular expression.Deprecated, for removal: This API element is subject to removal in a future version.Create a copy of theHttpRequestResponse
in temporary file.
This method is used to save theHttpRequestResponse
object to a temporary file, so that it is no longer held in memory.boolean
static HttpRequestResponse
httpRequestResponse
(HttpRequest request, HttpResponse response) Create a new instance ofHttpRequestResponse
.static HttpRequestResponse
httpRequestResponse
(HttpRequest httpRequest, HttpResponse httpResponse, Annotations annotations) Create a new instance ofHttpRequestResponse
.HTTP service for the request.request()
response()
short
Deprecated, for removal: This API element is subject to removal in a future version.useresponse()
statusCode instead.Retrieve the timing data associated with this request if available.url()
Deprecated, for removal: This API element is subject to removal in a future version.userequest()
url instead.withAnnotations
(Annotations annotations) Create a copy of theHttpRequestResponse
with the added annotations.withRequestMarkers
(Marker... requestMarkers) Create a copy of theHttpRequestResponse
with the added request markers.withRequestMarkers
(List<Marker> requestMarkers) Create a copy of theHttpRequestResponse
with the added request markers.withResponseMarkers
(Marker... responseMarkers) Create a copy of theHttpRequestResponse
with the added response markers.withResponseMarkers
(List<Marker> responseMarkers) Create a copy of theHttpRequestResponse
with the added response markers.
-
Method Details
-
request
HttpRequest request()- Returns:
- The HTTP request message.
-
response
HttpResponse response()- Returns:
- The HTTP response message.
-
httpService
HttpService httpService()HTTP service for the request.- Returns:
- An
HttpService
object containing details of the HTTP service.
-
annotations
Annotations annotations()- Returns:
- The annotations.
-
timingData
Optional<TimingData> timingData()Retrieve the timing data associated with this request if available.- Returns:
- The timing data.
-
url
Deprecated, for removal: This API element is subject to removal in a future version.userequest()
url instead.Retrieve the URL for the request.
If the request is malformed, then aMalformedRequestException
is thrown.- Returns:
- The URL in the request.
- Throws:
MalformedRequestException
- if request is malformed.
-
hasResponse
boolean hasResponse()- Returns:
- True if there is an HTTP response message.
-
contentType
Deprecated, for removal: This API element is subject to removal in a future version.userequest()
contentType instead.- Returns:
- The detected content type of the request.
-
statusCode
Deprecated, for removal: This API element is subject to removal in a future version.useresponse()
statusCode instead.HTTP status code contained in the response.- Returns:
- HTTP status code or -1 if there is no response.
-
requestMarkers
- Returns:
- List of request markers
-
responseMarkers
- Returns:
- List of response markers
-
contains
Searches the data in the HTTP request, response and notes 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
Searches the data in the HTTP request, response and notes for the specified regular expression.- Parameters:
pattern
- The regular expression to be searched for.- Returns:
- True if the pattern is matched.
-
copyToTempFile
HttpRequestResponse copyToTempFile()Create a copy of theHttpRequestResponse
in temporary file.
This method is used to save theHttpRequestResponse
object to a temporary file, so that it is no longer held in memory. Extensions can use this method to convertHttpRequest
objects into a form suitable for long-term usage.- Returns:
- A new
ByteArray
instance stored in temporary file.
-
withAnnotations
Create a copy of theHttpRequestResponse
with the added annotations.- Parameters:
annotations
- annotations to add.- Returns:
- A new
HttpRequestResponse
instance.
-
withRequestMarkers
Create a copy of theHttpRequestResponse
with the added request markers.- Parameters:
requestMarkers
- Request markers to add.- Returns:
- A new
HttpRequestResponse
instance.
-
withRequestMarkers
Create a copy of theHttpRequestResponse
with the added request markers.- Parameters:
requestMarkers
- Request markers to add.- Returns:
- A new
HttpRequestResponse
instance.
-
withResponseMarkers
Create a copy of theHttpRequestResponse
with the added response markers.- Parameters:
responseMarkers
- Response markers to add.- Returns:
- A new
HttpRequestResponse
instance.
-
withResponseMarkers
Create a copy of theHttpRequestResponse
with the added response markers.- Parameters:
responseMarkers
- Response markers to add.- Returns:
- A new
HttpRequestResponse
instance.
-
httpRequestResponse
Create a new instance ofHttpRequestResponse
.- Parameters:
request
- The HTTP request.response
- The HTTP response.- Returns:
- A new
HttpRequestResponse
instance.
-
httpRequestResponse
static HttpRequestResponse httpRequestResponse(HttpRequest httpRequest, HttpResponse httpResponse, Annotations annotations) Create a new instance ofHttpRequestResponse
.- Parameters:
httpRequest
- The HTTP request.httpResponse
- The HTTP response.annotations
- annotations.- Returns:
- A new
HttpRequestResponse
instance.
-
request()
contentType instead.