Class VirtualResponse
- Namespace
- AngleSharp.Io
- Assembly
- AngleSharp.dll
The virtual response class.
public class VirtualResponse : IResponse, IDisposable
- Inheritance
-
VirtualResponse
- Implements
- Inherited Members
- Extension Methods
Methods
Address(Url)
Sets the location of the response to the given url.
public VirtualResponse Address(Url url)
Parameters
url
UrlThe imaginary url of the response.
Returns
- VirtualResponse
The current instance.
Address(string)
Sets the location of the response to the provided address.
public VirtualResponse Address(string address)
Parameters
address
stringThe string to use as an url.
Returns
- VirtualResponse
The current instance.
Address(Uri)
Sets the location of the response to the uri's value.
public VirtualResponse Address(Uri url)
Parameters
url
UriThe Uri instance to convert.
Returns
- VirtualResponse
The current instance.
Content(Stream, bool)
Sets the response's content from the provided stream.
public VirtualResponse Content(Stream stream, bool shouldDispose = false)
Parameters
Returns
- VirtualResponse
The current instance.
Content(string)
Sets the response's content from the provided string.
public VirtualResponse Content(string text)
Parameters
text
stringThe text to use as content.
Returns
- VirtualResponse
The current instance.
Cookie(string)
Sets the value of the cookie associated with the response.
public VirtualResponse Cookie(string value)
Parameters
value
stringThe cookie's value.
Returns
- VirtualResponse
The current instance.
Create(Action<VirtualResponse>)
Creates a new virtual response.
public static IResponse Create(Action<VirtualResponse> request)
Parameters
request
Action<VirtualResponse>The request callback.
Returns
- IResponse
The resulted response.
Header(string, string)
Sets the header with the given name and value.
public VirtualResponse Header(string name, string value)
Parameters
Returns
- VirtualResponse
The current instance.
Headers(IDictionary<string, string>)
Sets the headers with the name of the keys and their assigned values.
public VirtualResponse Headers(IDictionary<string, string> headers)
Parameters
headers
IDictionary<string, string>The dictionary to use.
Returns
- VirtualResponse
The current instance.
Headers(object)
Sets the headers with the name of the properties and their assigned values.
public VirtualResponse Headers(object obj)
Parameters
obj
objectThe object to decompose.
Returns
- VirtualResponse
The current instance.
Status(int)
Sets the status code by providing the integer value.
public VirtualResponse Status(int code)
Parameters
code
intThe integer representing the code.
Returns
- VirtualResponse
The current instance.
Status(HttpStatusCode)
Sets the status code.
public VirtualResponse Status(HttpStatusCode code)
Parameters
code
HttpStatusCodeThe status code to set.
Returns
- VirtualResponse
The current instance.