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.
223 224 225 226 |
# File 'lib/datadog/core/remote/transport/http/config.rb', line 223 def initialize(path, encoder) super(:post, path) @encoder = encoder end |
Instance Attribute Details
#encoder ⇒ Object (readonly)
Returns the value of attribute encoder.
221 222 223 |
# File 'lib/datadog/core/remote/transport/http/config.rb', line 221 def encoder @encoder end |
Instance Method Details
#call(env, &block) ⇒ Object
228 229 230 231 232 233 234 235 236 237 238 239 240 |
# File 'lib/datadog/core/remote/transport/http/config.rb', line 228 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 = {} # Build and return a response Config::Response.new(http_response, ) end |