Method: Puppet::HTTP::Client#delete

Defined in:
lib/puppet/http/client.rb

#delete(url, headers: {}, params: {}, options: {}) ⇒ Puppet::HTTP::Response

Submits a DELETE HTTP request to the given url.

Parameters:

  • url (URI)

    the location to submit the http request

  • headers (Hash) (defaults to: {})

    merged with the default headers defined by the client

  • params (Hash) (defaults to: {})

    encoded and set as the url query

  • options (Hash) (defaults to: {})

    HTTP request options. Options not recognized by the HTTP implementation will be ignored.

Options Hash (options:):

  • :ssl_context (Puppet::SSL::SSLContext) — default: nil

    ssl context to be used for connections

  • :include_system_store (Boolean) — default: false

    if we should include the system store for connection

  • :redirect_limit (Integer) — default: 10

    The maximum number of HTTP redirections to allow for this request.

  • :basic_auth (Hash)

    A map of ‘:username` => `String` and `:password` => `String`

  • :metric_id (String)

    The metric id used to track metrics on requests.

Returns:



291
292
293
294
295
296
297
# File 'lib/puppet/http/client.rb', line 291

def delete(url, headers: {}, params: {}, options: {})
  url = encode_query(url, params)

  request = Net::HTTP::Delete.new(url, @default_headers.merge(headers))

  execute_streaming(request, options: options)
end