Class: Selenium::WebDriver::BiDi::InterceptedResponse Private

Inherits:
InterceptedItem show all
Defined in:
lib/selenium/webdriver/bidi/network/intercepted_response.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Attributes inherited from InterceptedItem

#network, #request

Instance Method Summary collapse

Methods inherited from InterceptedItem

#id

Constructor Details

#initialize(network, request) ⇒ InterceptedResponse

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of InterceptedResponse.



35
36
37
38
39
40
41
42
# File 'lib/selenium/webdriver/bidi/network/intercepted_response.rb', line 35

def initialize(network, request)
  super
  @reason = nil
  @status = nil
  @body = nil
  @headers = nil
  @cookies = nil
end

Instance Attribute Details

#bodyObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



33
34
35
# File 'lib/selenium/webdriver/bidi/network/intercepted_response.rb', line 33

def body
  @body
end

#reasonObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



32
33
34
# File 'lib/selenium/webdriver/bidi/network/intercepted_response.rb', line 32

def reason
  @reason
end

#statusObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



32
33
34
# File 'lib/selenium/webdriver/bidi/network/intercepted_response.rb', line 32

def status
  @status
end

Instance Method Details

#continueObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/selenium/webdriver/bidi/network/intercepted_response.rb', line 44

def continue
  cookies = @cookies&.as_json
  headers = @headers&.as_json
  network.continue_response(
    id: id,
    cookies: cookies,
    headers: headers,
    credentials: credentials.as_json,
    reason: reason,
    status: status
  )
end

#cookies(cookies = {}) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



82
83
84
# File 'lib/selenium/webdriver/bidi/network/intercepted_response.rb', line 82

def cookies(cookies = {})
  @cookies ||= Cookies.new(cookies)
end

#cookies=(cookies = {}) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



86
87
88
# File 'lib/selenium/webdriver/bidi/network/intercepted_response.rb', line 86

def cookies=(cookies = {})
  @cookies ||= Cookies.new(cookies)
end

#credentials(username: nil, password: nil) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



70
71
72
# File 'lib/selenium/webdriver/bidi/network/intercepted_response.rb', line 70

def credentials(username: nil, password: nil)
  @credentials ||= Credentials.new(username: username, password: password)
end

#headers(headers = {}) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



74
75
76
# File 'lib/selenium/webdriver/bidi/network/intercepted_response.rb', line 74

def headers(headers = {})
  @headers ||= Headers.new(headers)
end

#headers=(*headers) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



78
79
80
# File 'lib/selenium/webdriver/bidi/network/intercepted_response.rb', line 78

def headers=(*headers)
  @headers = Headers.new(headers)
end

#provide_responseObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/selenium/webdriver/bidi/network/intercepted_response.rb', line 57

def provide_response
  cookies = @cookies&.as_json
  headers = @headers&.as_json
  network.provide_response(
    id: id,
    cookies: cookies,
    headers: headers,
    body: body,
    reason: reason,
    status: status
  )
end