Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby Xively请求处理cUrl,但不与HttpParty合作_Ruby_Curl_Httparty_Xively - Fatal编程技术网

Ruby Xively请求处理cUrl,但不与HttpParty合作

Ruby Xively请求处理cUrl,但不与HttpParty合作,ruby,curl,httparty,xively,Ruby,Curl,Httparty,Xively,我尝试在没有API的情况下将Xively与Ruby一起使用,原因有二: -ruby API没有文档记录 -使用API端点也没有文档记录 因此,我可以使用curl发送一些信息,请参见:,并提出以下请求: curl --request PUT --data @content.json --header "X-ApiKey: <API_KEY>" --verbose https://api.xively.com/v2/feeds/1895459373 我的答案是: {"title"=&g

我尝试在没有API的情况下将Xively与Ruby一起使用,原因有二: -ruby API没有文档记录 -使用API端点也没有文档记录

因此,我可以使用curl发送一些信息,请参见:,并提出以下请求:

curl --request PUT --data @content.json --header "X-ApiKey: <API_KEY>" --verbose https://api.xively.com/v2/feeds/1895459373
我的答案是:

{"title"=>"Forbidden", "errors"=>"You do not have the necessary permissions to access this resource"}
在这两种情况下,正文的内容完全相同。我试过使用其他HTTP客户端,但似乎都不起作用,只有curl可以正常工作


你知道我遗漏了什么吗?

这颗宝石能让你更容易些吗@SteveTurczyn正如我所说,gem除了一个样本之外没有文档记录,并且没有给出如何在一次呼叫中向多个提要发送更新的线索,因此它是无用的。好吧,对不起,我误解了你的问题。API_密钥是如何设置的?curl示例是手动命令行?API_键是se如果值正确,我可以使用例如HttpParty来获取提要的信息。写部分也不起作用,我已经用竞争对手的ubidots做了一些测试,他们有相同类型的API,它工作得很好,所以它似乎是真正特定于Xively的东西,没有在任何地方解释过……你确定密钥有写访问权限吗?
{"title"=>"Forbidden", "errors"=>"You do not have the necessary permissions to access this resource"}