新手问题 发送文件到 API

luliangshu · June 11, 2014 · 1602 hits

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

开始处理

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

然后

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

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

No Reply at the moment.
You need to Sign in before reply, if you don't have an account, please Sign up first.