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.
249 250 251 252 |
# File 'lib/datadog/core/remote/transport/http/config.rb', line 249 def initialize(path, encoder) super(:post, path) @encoder = encoder end |
Instance Attribute Details
#encoder ⇒ Object (readonly)
Returns the value of attribute encoder.
247 248 249 |
# File 'lib/datadog/core/remote/transport/http/config.rb', line 247 def encoder @encoder end |
Instance Method Details
#call(env, &block) ⇒ Object
254 255 256 257 258 259 260 261 262 263 264 265 266 |
# File 'lib/datadog/core/remote/transport/http/config.rb', line 254 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 |