【发布时间】:2013-11-02 07:19:25
【问题描述】:
我正在尝试使用 HTTParty 来管理对 API 的请求。这些是文档中的说明:
网址:https://www.havelockinvestments.com/r/orderbook
必需的帖子变量符号:“VTX”
返回数据
状态:包含'ok'或'error'
消息:包含错误消息(如果适用)
bids: 包含 Bids 数组,作为 price=>amount 对
asks: 包含 Asks 数组,作为 price=>amount 对
这就是我在我的 Ruby 脚本中添加的内容:
require 'httparty'
response = HTTParty.post(
'https://www.havelockinvestments.com/r/orderbook',
:query => { :symbol => "VTX" }
)
但我收到错误响应:
{"status":"error","message":"post:symbol is required"}
发布符号变量时我在这里做错了什么?
【问题讨论】: