Reputation: 355474
I tried the following to upload a file with RestClient, but the resulting POST always uses the file's filename ("testfile.txt") instead of "file_name.txt":
RestClient::Resource.new(path, resource_options).post(:transfer => { :path => "file_name.txt" }, :upload => File.new('/tmp/testfile.txt', 'rb'))
Upvotes: 2
Views: 1414
Reputation: 11
If you want to specify a different name you can override the original_filename method of the File object you use
And you can use a String as payload, just pass your string
If you have other questions, you're welcome to ask them on the rest-client mailing list referenced on the project homepage
Upvotes: 1