lib/manifestly/http/client.rb in manifestly-client-0.0.1 vs lib/manifestly/http/client.rb in manifestly-client-1.0.0
- old
+ new
@@ -32,9 +32,20 @@
include_json_content_type!(headers)
include_json_accept!(headers)
Faraday.post(path, params.to_json, headers)
end
+ def put(path, params: {}, headers: {})
+ handle_request { raw_put("#{url}/#{api_version}/#{path}", params: params, headers: headers) }
+ end
+
+ private def raw_put(path, params: {}, headers: {})
+ include_api_key!(params)
+ include_json_content_type!(headers)
+ include_json_accept!(headers)
+ Faraday.put(path, params.to_json, headers)
+ end
+
def delete(path, params: {}, headers: {})
handle_request { raw_delete("#{url}/#{api_version}/#{path}", params: params, headers: headers) }
end
private def raw_delete(path, params: {}, headers: {})