Package burp.api.montoya.proxy.http
Interface InterceptedRequest
- All Superinterfaces:
HttpMessage,HttpRequest,InterceptedHttpMessage
HTTP request intercepted by Burp Proxy.
-
Method Summary
Modifier and TypeMethodDescriptionbody()Body of a message as a byte array.intOffset within the message where the message body begins.Body of a message as aString.This method retrieves the IP address for the destination of the intercepted message.headers()HTTP headers contained in the message.HTTP service for the request.HTTP Version text parsed from the request line for HTTP 1 messages.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.method()HTTP method for the request.path()Path and File for the request.This method retrieves the IP address for the source of the intercepted message.Message as a byte array.url()URL for the request.withAddedHeader(HttpHeader header) Create a copy of theHttpRequestwith the added header.withAddedHeader(String name, String value) Create a copy of theHttpRequestwith the added header.withAddedParameters(HttpParameter... parameters) Create a copy of theHttpRequestwith the added HTTP parameters.withAddedParameters(List<HttpParameter> parameters) Create a copy of theHttpRequestwith the added HTTP parameters.Create a copy of theHttpRequestwith the updated body.
Updates Content-Length header.Create a copy of theHttpRequestwith the updated body.
Updates Content-Length header.Create a copy of theHttpRequestwith added default headers.withMarkers(Marker... markers) Create a copy of theHttpRequestwith the added markers.withMarkers(List<Marker> markers) Create a copy of theHttpRequestwith the added markers.withMethod(String method) Create a copy of theHttpRequestwith the new method.Create a copy of theHttpRequestwith the new path.withRemovedHeader(HttpHeader header) Removes an existing HTTP header from the current request.withRemovedHeader(String name) Removes an existing HTTP header from the current request.withRemovedParameters(HttpParameter... parameters) Create a copy of theHttpRequestwith the removed HTTP parameters.withRemovedParameters(List<HttpParameter> parameters) Create a copy of theHttpRequestwith the removed HTTP parameters.withService(HttpService service) Create a copy of theHttpRequestwith the new service.withTransformationApplied(HttpTransformation transformation) Create a copy of theHttpRequestwith the transformation applied.withUpdatedHeader(HttpHeader header) Create a copy of theHttpRequestwith the updated header.withUpdatedHeader(String name, String value) Create a copy of theHttpRequestwith the updated header.withUpdatedParameters(HttpParameter... parameters) Create a copy of theHttpRequestwith the updated HTTP parameters.
If a parameter does not exist in the request, a new one will be added.withUpdatedParameters(List<HttpParameter> parameters) Create a copy of theHttpRequestwith the updated HTTP parameters.
If a parameter does not exist in the request, a new one will be added.Methods inherited from interface burp.api.montoya.http.message.requests.HttpRequest
copyToTempFile, toString
-
Method Details
-
annotations
Annotations annotations()- Returns:
- Annotations for request/response.
-
httpService
HttpService httpService()HTTP service for the request.- Specified by:
httpServicein interfaceHttpRequest- Returns:
- An
HttpServiceobject containing details of the HTTP service.
-
url
String url()URL for the request. If the request is malformed, then aMalformedRequestExceptionis thrown.- Specified by:
urlin interfaceHttpRequest- Returns:
- The URL in the request.
-
method
String method()HTTP method for the request. If the request is malformed, then aMalformedRequestExceptionis thrown.- Specified by:
methodin interfaceHttpRequest- Returns:
- The HTTP method used in the request.
-
path
String path()Path and File for the request. If the request is malformed, then aMalformedRequestExceptionis thrown.- Specified by:
pathin interfaceHttpRequest- Returns:
- the path and file in the request
-
httpVersion
String httpVersion()HTTP Version text parsed from the request line for HTTP 1 messages. HTTP 2 messages will return "HTTP/2"- Specified by:
httpVersionin interfaceHttpRequest- Returns:
- Version string
-
headers
List<HttpHeader> headers()HTTP headers contained in the message.- Specified by:
headersin interfaceHttpMessage- Specified by:
headersin interfaceHttpRequest- Returns:
- A list of HTTP headers.
-
contentType
ContentType contentType()- Specified by:
contentTypein interfaceHttpRequest- Returns:
- The detected content type of the request.
-
parameters
List<ParsedHttpParameter> parameters()- Specified by:
parametersin interfaceHttpRequest- Returns:
- The parameters contained in the request.
-
body
ByteArray body()Body of a message as a byte array.- Specified by:
bodyin interfaceHttpMessage- Specified by:
bodyin interfaceHttpRequest- 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 interfaceHttpRequest- 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 interfaceHttpRequest- Returns:
- The message body offset.
-
markers
Markers for the message.- Specified by:
markersin interfaceHttpMessage- Specified by:
markersin interfaceHttpRequest- Returns:
- A list of markers.
-
toByteArray
ByteArray toByteArray()Message as a byte array.- Specified by:
toByteArrayin interfaceHttpMessage- Specified by:
toByteArrayin interfaceHttpRequest- Returns:
- The message as a byte array.
-
withService
Create a copy of theHttpRequestwith the new service.- Specified by:
withServicein interfaceHttpRequest- Parameters:
service- AnHttpServicereference to add.- Returns:
- A new
HttpRequestinstance.
-
withPath
Create a copy of theHttpRequestwith the new path.- Specified by:
withPathin interfaceHttpRequest- Parameters:
path- The path to use.- Returns:
- A new
HttpRequestinstance with updated path.
-
withMethod
Create a copy of theHttpRequestwith the new method.- Specified by:
withMethodin interfaceHttpRequest- Parameters:
method- the method to use- Returns:
- a new
HttpRequestinstance with updated method.
-
withAddedParameters
Create a copy of theHttpRequestwith the added HTTP parameters.- Specified by:
withAddedParametersin interfaceHttpRequest- Parameters:
parameters- HTTP parameters to add.- Returns:
- A new
HttpRequestinstance.
-
withAddedParameters
Create a copy of theHttpRequestwith the added HTTP parameters.- Specified by:
withAddedParametersin interfaceHttpRequest- Parameters:
parameters- HTTP parameters to add.- Returns:
- A new
HttpRequestinstance.
-
withRemovedParameters
Create a copy of theHttpRequestwith the removed HTTP parameters.- Specified by:
withRemovedParametersin interfaceHttpRequest- Parameters:
parameters- HTTP parameters to remove.- Returns:
- A new
HttpRequestinstance.
-
withRemovedParameters
Create a copy of theHttpRequestwith the removed HTTP parameters.- Specified by:
withRemovedParametersin interfaceHttpRequest- Parameters:
parameters- HTTP parameters to remove.- Returns:
- A new
HttpRequestinstance.
-
withUpdatedParameters
Create a copy of theHttpRequestwith the updated HTTP parameters.
If a parameter does not exist in the request, a new one will be added.- Specified by:
withUpdatedParametersin interfaceHttpRequest- Parameters:
parameters- HTTP parameters to update.- Returns:
- A new
HttpRequestinstance.
-
withUpdatedParameters
Create a copy of theHttpRequestwith the updated HTTP parameters.
If a parameter does not exist in the request, a new one will be added.- Specified by:
withUpdatedParametersin interfaceHttpRequest- Parameters:
parameters- HTTP parameters to update.- Returns:
- A new
HttpRequestinstance.
-
withTransformationApplied
Create a copy of theHttpRequestwith the transformation applied.- Specified by:
withTransformationAppliedin interfaceHttpRequest- Parameters:
transformation- Transformation to apply.- Returns:
- A new
HttpRequestinstance.
-
withBody
Create a copy of theHttpRequestwith the updated body.
Updates Content-Length header.- Specified by:
withBodyin interfaceHttpRequest- Parameters:
body- the new body for the request- Returns:
- A new
HttpRequestinstance.
-
withBody
Create a copy of theHttpRequestwith the updated body.
Updates Content-Length header.- Specified by:
withBodyin interfaceHttpRequest- Parameters:
body- the new body for the request- Returns:
- A new
HttpRequestinstance.
-
withAddedHeader
Create a copy of theHttpRequestwith the added header.- Specified by:
withAddedHeaderin interfaceHttpRequest- Parameters:
name- The name of the header.value- The value of the header.- Returns:
- The updated HTTP request with the added header.
-
withAddedHeader
Create a copy of theHttpRequestwith the added header.- Specified by:
withAddedHeaderin interfaceHttpRequest- Parameters:
header- TheHttpHeaderto add to the HTTP request.- Returns:
- The updated HTTP request with the added header.
-
withUpdatedHeader
Create a copy of theHttpRequestwith the updated header.- Specified by:
withUpdatedHeaderin interfaceHttpRequest- Parameters:
name- The name of the header to update the value of.value- The new value of the specified HTTP header.- Returns:
- The updated request containing the updated header.
-
withUpdatedHeader
Create a copy of theHttpRequestwith the updated header.- Specified by:
withUpdatedHeaderin interfaceHttpRequest- Parameters:
header- TheHttpHeaderto update containing the new value.- Returns:
- The updated request containing the updated header.
-
withRemovedHeader
Removes an existing HTTP header from the current request.- Specified by:
withRemovedHeaderin interfaceHttpRequest- Parameters:
name- The name of the HTTP header to remove from the request.- Returns:
- The updated request containing the removed header.
-
withRemovedHeader
Removes an existing HTTP header from the current request.- Specified by:
withRemovedHeaderin interfaceHttpRequest- Parameters:
header- TheHttpHeaderto remove from the request.- Returns:
- The updated request containing the removed header.
-
withMarkers
Create a copy of theHttpRequestwith the added markers.- Specified by:
withMarkersin interfaceHttpRequest- Parameters:
markers- Request markers to add.- Returns:
- A new
MarkedHttpRequestResponseinstance.
-
withMarkers
Create a copy of theHttpRequestwith the added markers.- Specified by:
withMarkersin interfaceHttpRequest- Parameters:
markers- Request markers to add.- Returns:
- A new
MarkedHttpRequestResponseinstance.
-
withDefaultHeaders
HttpRequest withDefaultHeaders()Create a copy of theHttpRequestwith added default headers.- Specified by:
withDefaultHeadersin interfaceHttpRequest- Returns:
- a new (@code HttpRequest) with added default headers
-
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.
-