burp
Interface IHttpRequestResponse


public interface IHttpRequestResponse

This interface is used to allow extensions to access details of HTTP messages that are processed within Burp. Note that the setter methods generally can only be used before the message has been forwarded to the application (e.g. using IBurpExtender.processHttpMessage()) and not in read-only contexts (e.g. using IBurpExtender.getProxyHistory()). Conversely, the getter methods relating to response details can only be used after the message has been forwarded to the application.


Method Summary
 java.lang.String getComment()
          Returns the user-annotated comment for this item, if applicable.
 java.lang.String getHost()
          Returns the name of the application host.
 int getPort()
          Returns the port number used by the application.
 java.lang.String getProtocol()
          Returns the protocol used by the application.
 byte[] getRequest()
          Returns the full request contents.
 byte[] getResponse()
          Returns the full response contents.
 short getStatusCode()
          Returns the HTTP status code contained within the response.
 java.net.URL getUrl()
          Returns the URL within the request.
 void setComment(java.lang.String comment)
          Sets the user-annotated comment for this item.
 void setHost(java.lang.String host)
          Sets the name of the application host to which the request should be sent.
 void setPort(int port)
          Sets the port number to which the request should be sent.
 void setProtocol(java.lang.String protocol)
          Sets the protocol which should be used by the request.
 void setRequest(byte[] message)
          Sets the request contents which should be sent to the application.
 void setResponse(byte[] message)
          Sets the response contents which should be processed by the invoking Burp tool.
 

Method Detail

getHost

java.lang.String getHost()
Returns the name of the application host.

Returns:
The name of the application host.

getPort

int getPort()
Returns the port number used by the application.

Returns:
The port number used by the application.

getProtocol

java.lang.String getProtocol()
Returns the protocol used by the application.

Returns:
The protocol used by the application.

setHost

void setHost(java.lang.String host)
             throws java.lang.Exception
Sets the name of the application host to which the request should be sent.

Parameters:
host - The name of the application host to which the request should be sent.
Throws:
java.lang.Exception

setPort

void setPort(int port)
             throws java.lang.Exception
Sets the port number to which the request should be sent.

Parameters:
port - The port number to which the request should be sent.
Throws:
java.lang.Exception

setProtocol

void setProtocol(java.lang.String protocol)
                 throws java.lang.Exception
Sets the protocol which should be used by the request.

Parameters:
protocol - The protocol which should be used by the request. Valid values are "http" and "https".
Throws:
java.lang.Exception

getRequest

byte[] getRequest()
                  throws java.lang.Exception
Returns the full request contents.

Returns:
The full request contents.
Throws:
java.lang.Exception

getUrl

java.net.URL getUrl()
                    throws java.lang.Exception
Returns the URL within the request.

Returns:
The URL within the request.
Throws:
java.lang.Exception

setRequest

void setRequest(byte[] message)
                throws java.lang.Exception
Sets the request contents which should be sent to the application.

Parameters:
message - The request contents which should be sent to the application.
Throws:
java.lang.Exception

getResponse

byte[] getResponse()
                   throws java.lang.Exception
Returns the full response contents.

Returns:
The full response contents.
Throws:
java.lang.Exception

setResponse

void setResponse(byte[] message)
                 throws java.lang.Exception
Sets the response contents which should be processed by the invoking Burp tool.

Parameters:
message - The response contents which should be processed by the invoking Burp tool.
Throws:
java.lang.Exception

getStatusCode

short getStatusCode()
                    throws java.lang.Exception
Returns the HTTP status code contained within the response.

Returns:
The HTTP status code contained within the response.
Throws:
java.lang.Exception

getComment

java.lang.String getComment()
                            throws java.lang.Exception
Returns the user-annotated comment for this item, if applicable.

Returns:
The user-annotated comment for this item, or null if none is set.
Throws:
java.lang.Exception

setComment

void setComment(java.lang.String comment)
                throws java.lang.Exception
Sets the user-annotated comment for this item.

Parameters:
comment - The comment to be associated with this item.
Throws:
java.lang.Exception