class Playwright::Route::FulfillResponse

Included Modules

Defined in:

playwright/route.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(status : Int32 | Nil = nil, headers : Nil | Hash(String, String) = nil, content_type : Nil | String = nil, body : String = nil, path : Path | Nil = nil) #

[View source]

Instance Method Detail

def body : String #

[View source]
def body=(body : String) #

[View source]
def body_bytes : Bytes #

[View source]
def body_bytes=(body_bytes : Bytes) #

[View source]
def content_type : String | Nil #

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


[View source]
def content_type=(content_type : String | Nil) #

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


[View source]
def headers : Hash(String, String) | Nil #

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


[View source]
def headers=(headers : Hash(String, String) | Nil) #

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


[View source]
def 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.


[View source]
def 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.


[View source]
def status : Int32 | Nil #

Response status code, defaults to 200.


[View source]
def status=(status : Int32 | Nil) #

Response status code, defaults to 200.


[View source]