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 TypeMethodDescriptionCreate a copy of theHttpRequestResponsein temporary file.
This method is used to save theHttpRequestResponseobject to a temporary file, so that it is no longer held in memory.static HttpRequestResponsehttpRequestResponse(HttpRequest request, HttpResponse response) Create a new instance ofHttpRequestResponse.static HttpRequestResponsehttpRequestResponse(HttpRequest httpRequest, HttpResponse httpResponse, Annotations annotations) Create a new instance ofHttpRequestResponse.HTTP service for the request.request()response()shortHTTP status code contained in the response.url()Retrieve the URL for the request.
If the request is malformed, then aMalformedRequestExceptionis thrown.withAnnotations(Annotations annotations) Create a copy of theHttpRequestResponsewith the added annotations.withRequestMarkers(Marker... requestMarkers) Create a copy of theHttpRequestResponsewith the added request markers.withRequestMarkers(List<Marker> requestMarkers) Create a copy of theHttpRequestResponsewith the added request markers.withResponseMarkers(Marker... responseMarkers) Create a copy of theHttpRequestResponsewith the added response markers.withResponseMarkers(List<Marker> responseMarkers) Create a copy of theHttpRequestResponsewith the added response markers.
-
Method Details
-
request
HttpRequest request()- Returns:
- The HTTP request message.
-
response
HttpResponse response()- Returns:
- The HTTP response message.
-
annotations
Annotations annotations()- Returns:
- The annotations.
-
url
String url()Retrieve the URL for the request.
If the request is malformed, then aMalformedRequestExceptionis thrown.- Returns:
- The URL in the request.
- Throws:
MalformedRequestException- if request is malformed.
-
httpService
HttpService httpService()HTTP service for the request.- Returns:
- An
HttpServiceobject containing details of the HTTP service.
-
contentType
ContentType contentType()- Returns:
- The detected content type of the request.
-
statusCode
short statusCode()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
-
copyToTempFile
HttpRequestResponse copyToTempFile()Create a copy of theHttpRequestResponsein temporary file.
This method is used to save theHttpRequestResponseobject to a temporary file, so that it is no longer held in memory. Extensions can use this method to convertHttpRequestobjects into a form suitable for long-term usage.- Returns:
- A new
ByteArrayinstance stored in temporary file.
-
withAnnotations
Create a copy of theHttpRequestResponsewith the added annotations.- Parameters:
annotations- annotations to add.- Returns:
- A new
HttpRequestResponseinstance.
-
withRequestMarkers
Create a copy of theHttpRequestResponsewith the added request markers.- Parameters:
requestMarkers- Request markers to add.- Returns:
- A new
HttpRequestResponseinstance.
-
withRequestMarkers
Create a copy of theHttpRequestResponsewith the added request markers.- Parameters:
requestMarkers- Request markers to add.- Returns:
- A new
HttpRequestResponseinstance.
-
withResponseMarkers
Create a copy of theHttpRequestResponsewith the added response markers.- Parameters:
responseMarkers- Response markers to add.- Returns:
- A new
HttpRequestResponseinstance.
-
withResponseMarkers
Create a copy of theHttpRequestResponsewith the added response markers.- Parameters:
responseMarkers- Response markers to add.- Returns:
- A new
HttpRequestResponseinstance.
-
httpRequestResponse
Create a new instance ofHttpRequestResponse.- Parameters:
request- The HTTP request.response- The HTTP response.- Returns:
- A new
HttpRequestResponseinstance.
-
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
HttpRequestResponseinstance.
-