Method: TimeTree::HttpCommand#put

Defined in:
lib/timetree/http_command.rb

#put(path, body_params = {}) ⇒ Object

The request bodythat will eventually be converted to JSON.

Parameters:

  • path (String)

    String or URI to access.

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


40
41
42
43
44
45
46
47
# File 'lib/timetree/http_command.rb', line 40

def put(path, body_params = {})
  @logger.debug "PUT #{@host}#{path} body:#{body_params}"
  headers = {'Content-Type' => 'application/json'}
  res = connection.run_request :put, path, body_params.to_json, headers
  @client.update_ratelimit(res)
  @logger.debug "Response status:#{res.status}, body:#{res.body}"
  res
end