如何使用restclient

时间:2015-11-23 14:32:17

标签: ruby curl

curl http://192.168.253.7:8080/Example-1/restful/data/bulkUpload -H "API_KEY: se5ed3635ee24bb89dd72f" -H "TOKEN:1221231233" -F file=~/Desktop/Sample Import.xlsx

它通过终端正常工作。

我有上面的curl代码并将其转换为ruby代码,如下所示:

require 'rest-client'
RestClient.post(url,
                  :file => File.new(file_path),
                  headers: {'API_KEY' => Settings.API_KEY, 'TOKEN' => Settings.TOKEN})

但我仍然得到API _KEY不在标题回复中?

我在这里错过了什么吗?

感谢。

0 个答案:

没有答案
相关问题