Ruby rest-client file upload as multipart form data with basic authenticaion

后端 未结 4 1830
不思量自难忘°
不思量自难忘° 2021-02-05 22:02

I understand how to make an http request using basic authentication with Ruby\'s rest-client

response = RestClient::Request.new(:method => :get, :url => @b         


        
4条回答
  •  情书的邮戳
    2021-02-05 22:36

    The newest best way may be that: the link is enter link description here

      RestClient.post( url,
      {
        :transfer => {
          :path => '/foo/bar',
          :owner => 'that_guy',
          :group => 'those_guys'
        },
         :upload => {
          :file => File.new(path, 'rb')
        }
      })
    

提交回复
热议问题