Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- response = RestClient::Request.new(:method => :get, :url => @base_url + path, :user => @sid, :password => @token).execute
- RestClient.post '/data', :myfile => File.new("/path/to/image.jpg", 'rb')
- request = RestClient::Request.new(
- :method => :post,
- :url => '/data',
- :user => @sid,
- :password => @token,
- :payload => {
- :multipart => true,
- :file => File.new("/path/to/image.jpg", 'rb')
- })
- response = request.execute
- RestClient.post( url,
- {
- :transfer => {
- :path => '/foo/bar',
- :owner => 'that_guy',
- :group => 'those_guys'
- },
- :upload => {
- :file => File.new(path, 'rb')
- }
- })
- require 'rest-client'
- payload = {
- :multipart => true,
- :file => File.new('/path/to/file', 'rb'),
- :data => {foo: {bar: true}}.to_json
- }
- r = RestClient.post(url, payload, :authorization => token)
- response = RestClient::Request.execute(
- method: :post,
- url: url,
- user: 'username',
- password: 'password',
- timeout: 600, # Optional
- payload: {
- multipart: true,
- file: File.new('/path/to/file, 'rb')
- }
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement