class

Playwright::Route::FulfillResponse

Inherits JSON::Serializable / Reference / Object

Constructors

new(status : Int32 | Nil = nil, headers : Nil | Hash(String, String) = nil, content_type : Nil | String = nil, body : String = nil, path : Path | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

body
Source
body=(body : String)
Source
body_bytes
Source
body_bytes=(body_bytes : Bytes)
Source
content_type

If set, equals to setting Content-Type response header.

Source
content_type=(content_type : String | Nil)

If set, equals to setting Content-Type response header.

Source
headers

Optional response headers. Header values will be converted to a string.

Source
headers=(headers : Hash(String, String) | Nil)

Optional response headers. Header values will be converted to a string.

Source
path

Optional 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.

Source
path=(path : Path | Nil)

Optional 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.

Source
status

Response status code, defaults to 200.

Source
status=(status : Int32 | Nil)

Response status code, defaults to 200.

Source