Session Class |
Namespace: Fiddler
The Session type exposes the following members.
Name | Description | |
---|---|---|
Session(Session) |
Copy Constructor. | |
Session(SessionData) |
Create a Session object from a (serializable) SessionData object
| |
Session(Byte, Byte) |
Create a Session object from two byte[] representing request and response.
| |
Session(HTTPRequestHeaders, Byte) |
Initialize a new session from a given request headers and body request builder data. Note: No Session ID is assigned here.
| |
Session(Byte, Byte, SessionFlags) |
Create a Session object from two byte[] representing request and response. This is used when loading a Session Archive Zip.
|
Name | Description | |
---|---|---|
Abort |
Closes both client and server pipes and moves state to Aborted; unpauses thread if paused.
| |
BuildFromData |
Factory constructor
| |
COMETPeek |
Call this function while in the "reading response" state to update the responseBodyBytes array with
the partially read response.
| |
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetRedirectTargetURL |
Returns the fully-qualified URL to which this Session's response points, or null.
This method is needed because many servers (illegally) return a relative url in HTTP/3xx Location response headers.
| |
GetRedirectTargetURL(String, String) |
Gets a redirect-target from a base URI and a Location header
| |
GetRequestBodyAsString |
Return a string generated from the request body, decoding it and converting from a codepage if needed. Throws on errors.
| |
GetRequestBodyEncoding |
Find the text encoding of the request
WARNING: Will not decompress body to scan for indications of the character set
| |
GetResponseBodyAsString |
Return a string generated from the response body, decoding it and converting from a codepage if needed. Throws on errors.
| |
GetResponseBodyEncoding |
Find the text encoding of the response
WARNING: Will not decompress body to scan for indications of the character set
| |
GetResponseBodyHash | ||
GetResponseBodyHashAsBase64 | ||
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
HostnameIs |
Returns TRUE if the Session's target hostname (no port) matches sTestHost (case-insensitively).
| |
HTTPMethodIs |
Returns TRUE if the Session's HTTP Method is available and matches the target method.
| |
Ignore |
Set the SessionFlags.Ignore bit for this Session, also configuring it to stream, drop read data, and bypass event handlers.
For a CONNECT Tunnel, traffic will be blindly shuffled back and forth. Session will be hidden.
| |
isAnyFlagSet |
Test the session's BitFlags
| |
isFlagSet |
Test the session's BitFlags
| |
LoadMetadata |
Read metadata about this session from a stream. NB: Closes the Stream when done.
| |
LoadRequestBodyFromFile |
Replace HTTP request body using the specified file.
| |
LoadResponseFromFile |
Replace HTTP response headers and body using the specified file.
| |
LoadResponseFromStream |
Replace HTTP response headers and body using the specified stream.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
PoisonClientPipe |
Ensures that, after the response is complete, the client socket is closed and not reused.
Does NOT (and must not) close the pipe.
| |
PoisonServerPipe |
Prevents the server pipe from this session from being pooled for reuse
| |
SaveMetadata |
Writes this session's metadata to a file.
| |
SaveRequest(String, Boolean) |
Save the request to a file.
The headers' Request Line will not contain the scheme or host, which is probably not what you want.
| |
SaveRequest(String, Boolean, Boolean) |
Save the request to a file. Throws if file cannot be written.
| |
SaveRequestBody |
Save the request body to a file. You likely want to call utilDecodeRequest first.
| |
SaveResponse |
Saves the response (headers and body) to a file
| |
SaveResponseBody |
Save HTTP response body to Fiddler Captures folder. You likely want to call utilDecodeResponse first.
| |
SaveResponseBody(String) |
Save HTTP response body to specified location. You likely want to call utilDecodeResponse first.
| |
SaveSession |
Save the request and response to a single file.
| |
ThreadResume |
This method resumes the Session's thread in response to "Continue" commands from the UI
| |
ToHTMLFragment |
Returns HTML representing the Session. Call Utilities.StringToCF_HTML on the result of this function before placing it on the clipboard.
| |
ToString |
Store this session's request and response to a string.
(Overrides ObjectToString.) | |
ToString(Boolean) |
Store this session's request and response to a string.
| |
UNSTABLE_SetBitFlag |
DO NOT USE. TEMPORARY WHILE REFACTORING VISIBILITY OF MEMBERS
| |
uriContains |
Returns true if the absolute request URI contains the specified string. Case-insensitive.
| |
utilAssignResponse(Session) | ||
utilAssignResponse(HTTPResponseHeaders, Byte) | ||
utilBZIP2Response |
Use BZIP2 to compress the response body. Throws exceptions to caller.
| |
utilChunkResponse |
Introduces HTTP Chunked encoding on the response body
| |
utilCreateResponseAndBypassServer |
Call inside OnBeforeRequest to create a response object and bypass the server.
| |
utilDecodeRequest |
Removes chunking and HTTP Compression from the Request. Adds or updates Content-Length header.
| |
utilDecodeRequest(Boolean) | ||
utilDecodeResponse |
Removes chunking and HTTP Compression from the Response. Adds or updates Content-Length header.
| |
utilDecodeResponse(Boolean) |
Removes chunking and HTTP Compression from the Response. Adds or updates Content-Length header.
| |
utilDeflateResponse |
Use DEFLATE to compress the response body. Throws exceptions to caller.
| |
utilFindInRequest |
Find a string in the request body. Return its index, or -1.
| |
utilFindInResponse |
Find a string in the response body. Return its index, or -1.
| |
utilGZIPRequest |
Use GZIP to compress the request body. Throws exceptions to caller.
| |
utilGZIPResponse |
Use GZIP to compress the response body. Throws exceptions to caller.
| |
utilPrependToResponseBody |
Add a string to the top of the response body, updating Content-Length. (Call utilDecodeResponse first!)
| |
utilReplaceInRequest |
Perform a string replacement on the request body. Adjusts the Content-Length header if needed.
| |
utilReplaceInResponse |
Perform a string replacement on the response body (potentially multiple times). Adjust the Content-Length header if needed.
| |
utilReplaceOnceInResponse |
Perform a one-time string replacement on the response body. Adjust the Content-Length header if needed.
| |
utilReplaceRegexInResponse |
Perform a regex-based string replacement on the response body. Adjusts the Content-Length header if needed.
| |
utilSetRequestBody |
Replaces the request body with sString. Sets Content-Length header and removes Transfer-Encoding/Content-Encoding.
| |
utilSetResponseBody |
Replaces the response body with sString. Sets Content-Length header and removes Transfer-Encoding/Content-Encoding
| |
WriteMetadataToStream |
Write the metadata about this Session to a stream. The Stream is left open!
| |
WriteRequestToStream(Boolean, Boolean, Stream) |
Write the session's Request to the specified stream
| |
WriteRequestToStream(Boolean, Boolean, Boolean, Stream) |
Write the session's Request to the specified stream
| |
WriteResponseToStream |
Write the session's Response to the specified stream
| |
WriteToStream |
Write the session to the specified stream
|
Name | Description | |
---|---|---|
__oTunnel |
Used if the Session is bound to a WebSocket or CONNECTTunnel
| |
bBufferResponse |
Should response be buffered for tampering.
| |
m_clientIP |
IP Address of the client for this session.
| |
m_clientPort |
Client port attached to Fiddler.
| |
m_hostIP |
IP Address of the server for this session.
| |
oFlags |
Fiddler-internal flags set on the Session.
| |
oRequest |
Object representing the HTTP Request.
| |
oResponse |
Object representing the HTTP Response.
| |
requestBodyBytes |
Contains the bytes of the request body.
| |
responseBodyBytes |
Contains the bytes of the response body.
| |
Timers |
Timers stored as this Session progresses
| |
ViewItem |
Name | Description | |
---|---|---|
bHasResponse |
Returns TRUE if this session's State > ReadingResponse, and oResponse, oResponse.headers, and responseBodyBytes are all non-null. Note that
bHasResponse returns FALSE if the session is currently reading, even if a body was copied using the COMETPeek feature
| |
bHasWebSocketMessages |
Checks whether this is a WebSocket, and if so, whether it has logged any parsed messages.
| |
BitFlags |
Bitflags of commonly-queried session attributes
| |
bypassGateway |
Set to true in OnBeforeRequest if this request should bypass the gateway
| |
clientIP |
Returns the Address used by the client to communicate to Fiddler.
| |
clientPort |
Returns the port used by the client to communicate to Fiddler.
| |
fullUrl |
Retrieves the complete URI, including protocol/scheme, in the form http://www.host.com/filepath?query.
Or sets the complete URI, adjusting the UriScheme and/or Host.
| |
host |
DNS Name of the host server targeted by this request. May include IPv6 literal brackets. NB: a port# may be included.
| |
hostname |
DNS Name of the host server (no port) targeted by this request. Will include IPv6-literal brackets for IPv6-literal addresses
| |
id |
Returns the sequential number of this session. Note, by default numbering is restarted at zero when the session list is cleared.
| |
isFTP |
When true, this session was conducted using the FTP protocol.
| |
isHTTPS |
When true, this session was conducted using the HTTPS protocol.
| |
isTunnel |
Returns True if this is a HTTP CONNECT tunnel.
| |
ItemString |
Simple indexer into the Session's oFlags object; returns null if flag is not present.
| |
ItemString, String |
Indexer property into SESSION flags, REQUEST headers, and RESPONSE headers. e.g. oSession["Request", "Host"] returns string value for the Request host header. If null, returns String.Empty
| |
LocalProcess |
Get the Process Info of the application which made this request, or String.Empty if it is not known
| |
LocalProcessID |
Get the process ID of the application which made this request, or 0 if it cannot be determined.
| |
PathAndQuery |
Returns the path and query part of the URL. (For a CONNECT request, returns the host:port to be connected.)
| |
port |
Returns the server port to which this request is targeted.
| |
RequestBody |
Gets or Sets the HTTP Request body bytes.
Setter adjusts Content-Length header, and removes Transfer-Encoding and Content-Encoding headers.
Setter DOES NOT CLONE the passed array.
Setter will throw if the Request object does not exist for some reason.
Use utilSetRequestBody(sStr) to ensure proper character encoding if you need to use a string.
| |
RequestHeaders | ||
RequestMethod | ||
ResponseBody |
Gets or Sets the HTTP Response body bytes.
Setter adjusts Content-Length header, and removes Transfer-Encoding and Content-Encoding headers.
Setter DOES NOT CLONE the passed array.
Setter will throw if the Response object has not yet been created. (See utilCreateResponseAndBypassServer)
Use utilSetResponseBody(sStr) to ensure proper character encoding if you need to use a string.
| |
responseCode |
Gets or Sets the HTTP Status code of the server's response
| |
ResponseHeaders | ||
state |
State of session. Note Side-Effects: If setting to .Aborted, calls FinishUISession. If setting to/from a Tamper state, calls RefreshMyInspectors
| |
SuggestedFilename |
Gets a path-less filename suitable for saving the Response entity. Uses Content-Disposition if available.
| |
Tag |
A common use for the Tag property is to store data that is closely associated with the Session.
It is NOT marshalled during drag/drop and is NOT serialized to a SAZ file.
| |
TunnelEgressByteCount |
If this session is a Tunnel, returns number of bytes sent from the Client to the Server
| |
TunnelIngressByteCount |
If this session is a Tunnel, returns number of bytes sent from the Server to the Client
| |
TunnelIsOpen |
If this session is a Tunnel, and the tunnel's IsOpen property is TRUE, returns TRUE. Otherwise returns FALSE.
| |
url |
Gets or sets the URL (without protocol) being requested from the server, in the form www.host.com/filepath?query.
|
Name | Description | |
---|---|---|
OnCompleteTransaction | ||
OnContinueTransaction |
This event fires if this Session automatically yields a new one, for instance, if Fiddler is configured to automatically
follow redirects or perform multi-leg authentication (X-AutoAuth).
| |
OnStateChanged |
This event fires at any time the session's State changes. Use with caution due to the potential for performance impact.
|