清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>
url = 'http://xx' #post到url field_hash = {key: key, token: token} #post数据 request = RestClient.post url, field_hash.merge(file: File.new(File.join('public', "#{params[:logo]}"), 'rb')) #上传文件 reponse = request.to_s #返回结果