Class: Virgil::SDK::Client::HTTP::Request

Inherits:
Struct
  • Object
show all
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

Instance Method Summary collapse

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

#bodyHash

request body

Returns:

  • (Hash)

    the current value of body



44
45
46
# File 'lib/virgil/sdk/client/http/request.rb', line 44

def body
  @body
end

#endpointString

request endpoint

Returns:

  • (String)

    the current value of endpoint



44
45
46
# File 'lib/virgil/sdk/client/http/request.rb', line 44

def endpoint
  @endpoint
end

#headersHash

dict of request additional unencoded HTTP headers(key/value pairs)

Returns:

  • (Hash)

    the current value of headers



44
45
46
# File 'lib/virgil/sdk/client/http/request.rb', line 44

def headers
  @headers
end

#methodString

http request method

Returns:

  • (String)

    the current value of method



44
45
46
# File 'lib/virgil/sdk/client/http/request.rb', line 44

def method
  @method
end