Click or drag to resize
Session Methods

The Session type exposes the following members.

Methods
  NameDescription
Public methodAbort
Closes both client and server pipes and moves state to Aborted; unpauses thread if paused.
Public methodStatic memberBuildFromData
Factory constructor
Public methodCOMETPeek
Call this function while in the "reading response" state to update the responseBodyBytes array with the partially read response.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetRedirectTargetURL
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.
Public methodStatic memberGetRedirectTargetURL(String, String)
Gets a redirect-target from a base URI and a Location header
Public methodGetRequestBodyAsString
Return a string generated from the request body, decoding it and converting from a codepage if needed. Throws on errors.
Public methodGetRequestBodyEncoding
Find the text encoding of the request WARNING: Will not decompress body to scan for indications of the character set
Public methodGetResponseBodyAsString
Return a string generated from the response body, decoding it and converting from a codepage if needed. Throws on errors.
Public methodGetResponseBodyEncoding
Find the text encoding of the response WARNING: Will not decompress body to scan for indications of the character set
Public methodGetResponseBodyHash
Public methodGetResponseBodyHashAsBase64
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodHostnameIs
Returns TRUE if the Session's target hostname (no port) matches sTestHost (case-insensitively).
Public methodHTTPMethodIs
Returns TRUE if the Session's HTTP Method is available and matches the target method.
Public methodIgnore
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.
Public methodisAnyFlagSet
Test the session's BitFlags
Public methodisFlagSet
Test the session's BitFlags
Public methodLoadMetadata
Read metadata about this session from a stream. NB: Closes the Stream when done.
Public methodLoadRequestBodyFromFile
Replace HTTP request body using the specified file.
Public methodLoadResponseFromFile
Replace HTTP response headers and body using the specified file.
Public methodLoadResponseFromStream
Replace HTTP response headers and body using the specified stream.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodPoisonClientPipe
Ensures that, after the response is complete, the client socket is closed and not reused. Does NOT (and must not) close the pipe.
Public methodPoisonServerPipe
Prevents the server pipe from this session from being pooled for reuse
Public methodSaveMetadata
Writes this session's metadata to a file.
Public methodSaveRequest(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.
Public methodSaveRequest(String, Boolean, Boolean)
Save the request to a file. Throws if file cannot be written.
Public methodSaveRequestBody
Save the request body to a file. You likely want to call utilDecodeRequest first.
Public methodSaveResponse
Saves the response (headers and body) to a file
Public methodSaveResponseBody
Save HTTP response body to Fiddler Captures folder. You likely want to call utilDecodeResponse first.
Public methodSaveResponseBody(String)
Save HTTP response body to specified location. You likely want to call utilDecodeResponse first.
Public methodSaveSession
Save the request and response to a single file.
Public methodThreadResume
This method resumes the Session's thread in response to "Continue" commands from the UI
Public methodToHTMLFragment
Returns HTML representing the Session. Call Utilities.StringToCF_HTML on the result of this function before placing it on the clipboard.
Public methodToString
Store this session's request and response to a string.
(Overrides ObjectToString.)
Public methodToString(Boolean)
Store this session's request and response to a string.
Public methodUNSTABLE_SetBitFlag
DO NOT USE. TEMPORARY WHILE REFACTORING VISIBILITY OF MEMBERS
Public methoduriContains
Returns true if the absolute request URI contains the specified string. Case-insensitive.
Public methodutilAssignResponse(Session)
Public methodutilAssignResponse(HTTPResponseHeaders, Byte)
Public methodutilBZIP2Response
Use BZIP2 to compress the response body. Throws exceptions to caller.
Public methodutilChunkResponse
Introduces HTTP Chunked encoding on the response body
Public methodutilCreateResponseAndBypassServer
Call inside OnBeforeRequest to create a response object and bypass the server.
Public methodutilDecodeRequest
Removes chunking and HTTP Compression from the Request. Adds or updates Content-Length header.
Public methodutilDecodeRequest(Boolean)
Public methodutilDecodeResponse
Removes chunking and HTTP Compression from the Response. Adds or updates Content-Length header.
Public methodutilDecodeResponse(Boolean)
Removes chunking and HTTP Compression from the Response. Adds or updates Content-Length header.
Public methodutilDeflateResponse
Use DEFLATE to compress the response body. Throws exceptions to caller.
Public methodutilFindInRequest
Find a string in the request body. Return its index, or -1.
Public methodutilFindInResponse
Find a string in the response body. Return its index, or -1.
Public methodutilGZIPRequest
Use GZIP to compress the request body. Throws exceptions to caller.
Public methodutilGZIPResponse
Use GZIP to compress the response body. Throws exceptions to caller.
Public methodutilPrependToResponseBody
Add a string to the top of the response body, updating Content-Length. (Call utilDecodeResponse first!)
Public methodutilReplaceInRequest
Perform a string replacement on the request body. Adjusts the Content-Length header if needed.
Public methodutilReplaceInResponse
Perform a string replacement on the response body (potentially multiple times). Adjust the Content-Length header if needed.
Public methodutilReplaceOnceInResponse
Perform a one-time string replacement on the response body. Adjust the Content-Length header if needed.
Public methodutilReplaceRegexInResponse
Perform a regex-based string replacement on the response body. Adjusts the Content-Length header if needed.
Public methodutilSetRequestBody
Replaces the request body with sString. Sets Content-Length header and removes Transfer-Encoding/Content-Encoding.
Public methodutilSetResponseBody
Replaces the response body with sString. Sets Content-Length header and removes Transfer-Encoding/Content-Encoding
Public methodWriteMetadataToStream
Write the metadata about this Session to a stream. The Stream is left open!
Public methodWriteRequestToStream(Boolean, Boolean, Stream)
Write the session's Request to the specified stream
Public methodWriteRequestToStream(Boolean, Boolean, Boolean, Stream)
Write the session's Request to the specified stream
Public methodWriteResponseToStream
Write the session's Response to the specified stream
Public methodWriteToStream
Write the session to the specified stream
Top
See Also