Class RouteFulfillOptions
- Namespace
- Microsoft.Playwright
- Assembly
- Microsoft.Playwright.dll
public class RouteFulfillOptions
- Inheritance
-
RouteFulfillOptions
- Inherited Members
Constructors
RouteFulfillOptions()
public RouteFulfillOptions()
RouteFulfillOptions(RouteFulfillOptions)
public RouteFulfillOptions(RouteFulfillOptions clone)
Parameters
clone
RouteFulfillOptions
Properties
Body
Optional response body as text.
[JsonPropertyName("body")]
public string? Body { get; set; }
Property Value
BodyBytes
Optional response body as raw bytes.
[JsonPropertyName("bodyBytes")]
public byte[]? BodyBytes { get; set; }
Property Value
- byte[]
ContentType
If set, equals to setting Content-Type
response header.
[JsonPropertyName("contentType")]
public string? ContentType { get; set; }
Property Value
Headers
Response headers. Header values will be converted to a string.
[JsonPropertyName("headers")]
public IEnumerable<KeyValuePair<string, string>>? Headers { get; set; }
Property Value
Json
JSON response. This method will set the content type to application/json
if not set.
[JsonPropertyName("json")]
public object? Json { get; set; }
Property Value
Path
File path to respond with. The content type will be inferred from file extension.
If path
is a relative path, then it is resolved relative to the current working
directory.
[JsonPropertyName("path")]
public string? Path { get; set; }
Property Value
Response
IAPIResponse to fulfill route's request with. Individual fields of the response (such as headers) can be overridden using fulfill options.
[JsonPropertyName("response")]
public IAPIResponse? Response { get; set; }
Property Value
Status
Response status code, defaults to 200
.
[JsonPropertyName("status")]
public int? Status { get; set; }
Property Value
- int?