Class: WebkitRemote::Client::NetworkRequest
- Inherits:
-
Object
- Object
- WebkitRemote::Client::NetworkRequest
- Defined in:
- lib/webkit_remote/client/network_events.rb
Overview
Wraps information about HTTP requests.
Instance Attribute Summary collapse
-
#body ⇒ String
readonly
The body of a POST request.
-
#headers ⇒ Hash<String, String>
readonly
The HTTP headers of the request.
-
#method ⇒ Symbol?
readonly
HTTP request method, e.g.
-
#url ⇒ String
readonly
The URL of the request.
Instance Method Summary collapse
-
#initialize(raw_response) ⇒ NetworkRequest
constructor
A new instance of NetworkRequest.
Constructor Details
#initialize(raw_response) ⇒ NetworkRequest
Returns a new instance of NetworkRequest.
362 363 364 365 366 367 368 |
# File 'lib/webkit_remote/client/network_events.rb', line 362 def initialize(raw_response) @headers = raw_response['headers'] || {} @method = raw_response['method'] ? raw_response['method'].downcase.to_sym : nil @body = raw_response['postData'] @url = raw_response['url'] end |
Instance Attribute Details
#body ⇒ String (readonly)
Returns the body of a POST request.
356 357 358 |
# File 'lib/webkit_remote/client/network_events.rb', line 356 def body @body end |
#headers ⇒ Hash<String, String> (readonly)
Returns the HTTP headers of the request.
353 354 355 |
# File 'lib/webkit_remote/client/network_events.rb', line 353 def headers @headers end |
#method ⇒ Symbol? (readonly)
Returns HTTP request method, e.g. :get.
350 351 352 |
# File 'lib/webkit_remote/client/network_events.rb', line 350 def method @method end |
#url ⇒ String (readonly)
Returns the URL of the request.
347 348 349 |
# File 'lib/webkit_remote/client/network_events.rb', line 347 def url @url end |