lib/nsisam/client.rb in nsisam-0.7.5 vs lib/nsisam/client.rb in nsisam-0.7.6

- old
+ new

@@ -40,11 +40,11 @@ # @example # nsisam.store("something") def store(data) request_data = {:value => data} request_data[:expire] = @expire if @expire - request = prepare_request :PUT, request_data.to_json + request = prepare_request :POST, request_data.to_json Response.new(execute_request(request)) end # Store a file in SAM. If the file will be used by other NSI's service # you should pass an additional 'type' parameter. @@ -52,11 +52,11 @@ # @param [Object] file_content json serializable object # @param [Symbol] type of the file to be stored. Can be either :doc and :video. # @return [Response] object with access to the key and the sha512 checkum of the stored data # # @raise [NSISam::Errors::Client::AuthenticationError] when user and password doesn't match - # + # # @example # nsisam.store_file(File.read("foo.txt")) # nsisam.store_file(File.read("foo.txt"), :video) def store_file(file_content, filename, type=:file) store(type => Base64.encode64(file_content), :filename => filename) @@ -134,10 +134,10 @@ # @example # nsisam.update("my key", "my value") def update(key, value) request_data = {:key => key, :value => value} request_data[:expire] = @expire if @expire - request = prepare_request :POST, request_data.to_json + request = prepare_request :PUT, request_data.to_json Response.new(execute_request(request)) end # Update file stored at a given SAM key #