Class: Datadog::Core::Remote::Transport::HTTP::Config::API::Endpoint
- Inherits:
-
Transport::HTTP::API::Endpoint
- Object
- Transport::HTTP::API::Endpoint
- Datadog::Core::Remote::Transport::HTTP::Config::API::Endpoint
- Defined in:
- lib/datadog/core/remote/transport/http/config.rb
Overview
Endpoint for remote configuration
Constant Summary collapse
- HEADER_CONTENT_TYPE =
'Content-Type'
Instance Attribute Summary collapse
-
#encoder ⇒ Object
readonly
Returns the value of attribute encoder.
Attributes inherited from Transport::HTTP::API::Endpoint
Instance Method Summary collapse
- #call(env, &block) ⇒ Object
-
#initialize(path, encoder) ⇒ Endpoint
constructor
A new instance of Endpoint.
Constructor Details
#initialize(path, encoder) ⇒ Endpoint
Returns a new instance of Endpoint.
207 208 209 210 |
# File 'lib/datadog/core/remote/transport/http/config.rb', line 207 def initialize(path, encoder) super(:post, path) @encoder = encoder end |
Instance Attribute Details
#encoder ⇒ Object (readonly)
Returns the value of attribute encoder.
205 206 207 |
# File 'lib/datadog/core/remote/transport/http/config.rb', line 205 def encoder @encoder end |
Instance Method Details
#call(env, &block) ⇒ Object
212 213 214 215 216 217 218 219 220 221 222 223 224 |
# File 'lib/datadog/core/remote/transport/http/config.rb', line 212 def call(env, &block) # Encode body & type env.headers[HEADER_CONTENT_TYPE] = encoder.content_type env.body = env.request.parcel.data # Query for response http_response = super(env, &block) = {} # Build and return a response Config::Response.new(http_response, ) end |