来自 Bitstamp.net 的空响应

Cha*_*les 1 api rest http

我正在尝试使用 Bitstamp 的私有 api 来查询我的帐户余额。我相信我发布了正确的数据,因为没有返回错误,但 Bitstamp 的答案始终为空

*   Trying 107.154.249.133...
* Connected to www.bitstamp.net (107.154.249.133) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection:         
ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* NPN, negotiated HTTP1.1
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
*    subject: OU=Domain Control Validated; CN=*.bitstamp.net
*    start date: Apr  8 14:11:39 2015 GMT
*    expire date: Apr  8 15:48:13 2018 GMT
*    subjectAltName: www.bitstamp.net matched
*    issuer: C=US; ST=Arizona; L=Scottsdale; O=GoDaddy.com, Inc.;     
OU=http://certs.godaddy.com/repository/; CN=Go Daddy Secure Certificate     
Authority - G2
*    SSL certificate verify ok.
> POST /api/v2/balance HTTP/1.1
Host: www.bitstamp.net
User-Agent: Bitstamp C++ API Client
Accept: */*
Content-Length: 134
Content-Type: application/x-www-form-urlencoded

* upload completely sent off: 134 out of 134 bytes
< HTTP/1.1 301 MOVED PERMANENTLY
< Access-Control-Allow-Headers: x-requested-with, Content-Type, origin, accept, cache-control
< Access-Control-Allow-Methods: POST, GET
< Access-Control-Allow-Origin: *
< Content-Language: en
< Content-Type: text/html; charset=utf-8
< Date: Fri, 08 Sep 2017 17:46:41 GMT
< Location: http://www.bitstamp.net/api/v2/balance/
< Server: Apache
< Strict-Transport-Security: max-age=63072000; includeSubDomains
< Vary: Accept-Language
< X-Frame-Options: SAMEORIGIN
< Content-Length: 0
< Connection: keep-alive
< Set-Cookie: visid_incap_99025=wHhR5uPzT92ReB9XbeNToIHXslkAAAAAQUIPAAAAAAAbNQJEog5ZojcqdOv0dFhd; expires=Sat, 08 Sep 2018 10:32:13 GMT; path=/; Domain=.bitstamp.net
< Set-Cookie: nlbi_99025=VyBXXwUOsQHckThX8F1n9AAAAABOW3tLZ0nUHyp47yinIimv; path=/; Domain=.bitstamp.net
< Set-Cookie: incap_ses_569_99025=04PeXe3KGFAAVw//8n7lB4HXslkAAAAA09BkGnsaiskl2dkFxzhFXQ==; path=/; Domain=.bitstamp.net
< X-Iinfo: 9-15073063-15060114 PNNN RT(1504892800858 31) q(0 0 0 -1) r(2 2)     U6
< X-CDN: Incapsula
< 
* Connection #0 to host www.bitstamp.net left intact
result: 0
response: 
terminate called after throwing an instance of 'std::runtime_error'
  what():  Bitstamp response doesn't contain result data
Run Code Online (Sandbox Code Playgroud)

任何的想法 ?非常感谢!

小智 6

最初我的平衡路径是/balance,但是在更改为/balance/它后,它工作并用有效载荷返回了 200。

所以不要http://www.bitstamp.net/api/v2/balance使用http://www.bitstamp.net/api/v2/balance/,请注意尾随的反斜杠