Class: AWS::Core::Http::Request
- Inherits:
-
Object
- Object
- AWS::Core::Http::Request
- Defined in:
- lib/aws/core/http/request.rb
Overview
Base class for all service reqeusts. This class describes a basic HTTP request, but will not make one. It is consumed by a HTTP handler class that sends the actual request and parses the actual response.
Instance Attribute Summary collapse
-
#access_key_id ⇒ String
Returns the AWS access key ID used to authorize the request.
-
#body ⇒ String?
Returns the request body (payload).
-
#default_read_timeout ⇒ Integer
The number of seconds the service has to respond before a timeout error is raised on the request.
-
#headers ⇒ Hash
Returns a hash of header values.
-
#host ⇒ String
Returns hostname of the request.
-
#http_method ⇒ String
Returns the HTTP request method (e.g. ‘GET’, ‘PUT’, ‘POST’, ‘HEAD’ or ‘DELETE’).
-
#port ⇒ Integer
Returns the port the request will be made over.
-
#proxy_uri ⇒ nil, URI
The URI to the proxy server requests are sent through if configured.
-
#read_timeout ⇒ Integer
writeonly
The number of seconds the service has to respond before a timeout error is raised on the request.
-
#region ⇒ String
The region name this request is for.
-
#service_ruby_name ⇒ String
The name of the service for Signature v4 signing.
-
#ssl_ca_file ⇒ String
Returns the path to a bundle of CA certs in PEM format; the HTTP handler should use this to verify all HTTPS requests if #ssl_verify_peer? is true.
-
#ssl_ca_path ⇒ String
Returns the path to a directory of CA certs.
-
#ssl_verify_peer ⇒ Boolean
(also: #ssl_verify_peer?)
Returns
trueif the client should verify the peer certificate. -
#uri ⇒ String
Returns the request URI (path + querystring).
-
#use_ssl ⇒ Boolean
(also: #use_ssl?)
Returns
trueif this request should be made with SSL enabled.
Instance Method Summary collapse
-
#initialize ⇒ Request
constructor
Returns a new empty http request object.
-
#path ⇒ String
Returns the HTTP request path.
-
#querystring ⇒ String
Returns the HTTP request querystring.
Constructor Details
#initialize ⇒ Request
Returns a new empty http request object.
25 26 27 28 29 30 31 32 |
# File 'lib/aws/core/http/request.rb', line 25 def initialize @default_read_timeout = 60 @http_method = 'POST' @use_ssl = true @headers = CaseInsensitiveHash.new @uri = '/' @params = [] end |
Instance Attribute Details
#access_key_id ⇒ String
62 63 64 |
# File 'lib/aws/core/http/request.rb', line 62 def access_key_id @access_key_id end |
#body ⇒ String?
72 73 74 |
# File 'lib/aws/core/http/request.rb', line 72 def body @body end |
#default_read_timeout ⇒ Integer
37 38 39 |
# File 'lib/aws/core/http/request.rb', line 37 def default_read_timeout @default_read_timeout end |
#headers ⇒ Hash
51 52 53 |
# File 'lib/aws/core/http/request.rb', line 51 def headers @headers end |
#host ⇒ String
40 41 42 |
# File 'lib/aws/core/http/request.rb', line 40 def host @host end |
#http_method ⇒ String
48 49 50 |
# File 'lib/aws/core/http/request.rb', line 48 def http_method @http_method end |
#port ⇒ Integer
44 45 46 |
# File 'lib/aws/core/http/request.rb', line 44 def port @port end |
#proxy_uri ⇒ nil, URI
85 86 87 |
# File 'lib/aws/core/http/request.rb', line 85 def proxy_uri @proxy_uri end |
#read_timeout=(value) ⇒ Integer
90 91 92 |
# File 'lib/aws/core/http/request.rb', line 90 def read_timeout=(value) @read_timeout = value end |
#region ⇒ String
58 59 60 |
# File 'lib/aws/core/http/request.rb', line 58 def region @region end |
#service_ruby_name ⇒ String
81 82 83 |
# File 'lib/aws/core/http/request.rb', line 81 def service_ruby_name @service_ruby_name end |
#ssl_ca_file ⇒ String
107 108 109 |
# File 'lib/aws/core/http/request.rb', line 107 def ssl_ca_file @ssl_ca_file end |
#ssl_ca_path ⇒ String
112 113 114 |
# File 'lib/aws/core/http/request.rb', line 112 def ssl_ca_path @ssl_ca_path end |
#ssl_verify_peer ⇒ Boolean Also known as: ssl_verify_peer?
100 101 102 |
# File 'lib/aws/core/http/request.rb', line 100 def ssl_verify_peer @ssl_verify_peer end |
#uri ⇒ String
54 55 56 |
# File 'lib/aws/core/http/request.rb', line 54 def uri @uri end |
#use_ssl ⇒ Boolean Also known as: use_ssl?
94 95 96 |
# File 'lib/aws/core/http/request.rb', line 94 def use_ssl @use_ssl end |
Instance Method Details
#path ⇒ String
134 135 136 |
# File 'lib/aws/core/http/request.rb', line 134 def path uri.split(/\?/)[0] end |
#querystring ⇒ String
139 140 141 |
# File 'lib/aws/core/http/request.rb', line 139 def querystring uri.split(/\?/)[1] end |