Method: CrAPI::Client#delete

Defined in:
lib/crapi/client.rb

#delete(path, headers: {}, query: {}) ⇒ Object

CRUD method: DELETE

Parameters:

  • path (String)

    The path to the resource to DELETE. Note that this path is always interpreted as relative to the client's base_uri's path, regardless of whether it begins with a "/".

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

    Additional headers to set in addition to the client's defaults. Any header given here and also appearing in the client's defaults will override said default value.

  • query (Hash, Array, String) (defaults to: {})

    Query string values, if any, to append to the given path. Strings are appended as-is; Hashes and Arrays are serialized as URI-encoded form data before appending.

Returns:

  • (Object)


112
113
114
115
116
117
118
# File 'lib/crapi/client.rb', line 112

def delete(path, headers: {}, query: {})
  headers = @default_headers.merge(headers)

  response = @http.delete(full_path(path, query: query), headers)
  ensure_success!(response)
  parse_response(response)
end