Class: Virgil::SDK::Client::HTTP::Request
- Inherits:
-
Struct
- Object
- Struct
- Virgil::SDK::Client::HTTP::Request
- Defined in:
- lib/virgil/sdk/client/http/request.rb
Overview
Http request wrapper.
Constant Summary collapse
- GET =
:get
- POST =
:post
- PUT =
:put
- DELETE =
:delete
Instance Attribute Summary collapse
-
#body ⇒ Hash
request body.
-
#endpoint ⇒ String
request endpoint.
-
#headers ⇒ Hash
dict of request additional unencoded HTTP headers(key/value pairs).
-
#method ⇒ String
http request method.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Request
constructor
Constructs new Request object.
Constructor Details
#initialize(attributes) ⇒ Request
Constructs new Request object.
46 47 48 49 50 51 |
# File 'lib/virgil/sdk/client/http/request.rb', line 46 def initialize(attributes) self.endpoint = attributes[:endpoint] self.body = attributes[:body] self.headers = attributes[:headers] self.method = attributes[:method] end |
Instance Attribute Details
#body ⇒ Hash
request body
44 45 46 |
# File 'lib/virgil/sdk/client/http/request.rb', line 44 def body @body end |
#endpoint ⇒ String
request endpoint
44 45 46 |
# File 'lib/virgil/sdk/client/http/request.rb', line 44 def endpoint @endpoint end |
#headers ⇒ Hash
dict of request additional unencoded HTTP headers(key/value pairs)
44 45 46 |
# File 'lib/virgil/sdk/client/http/request.rb', line 44 def headers @headers end |
#method ⇒ String
http request method
44 45 46 |
# File 'lib/virgil/sdk/client/http/request.rb', line 44 def method @method end |