新手问题 发送文件到 API

luliangshu · 2014年06月11日 · 1602 次阅读

我要把上传的文件 post 到某个 API 使用了 rest_client

开始处理

userMessage[:upload] = File.new(params[:upload] ,'rb')

然后

response = RestClient.post(
    url,
     userMessage,
     :content_type => params[:upload].content_type
)

从图中看出 我的发过去的 1207 1208 没有文件格式

暂无回复。
需要 登录 后方可回复, 如果你还没有账号请 注册新账号