I tried to follow this post on how to set headers for GET/post requests.
url:
https://api.binance.com/api/v3/account?timestamp=1521742176&recvWindow=5000000000000&signature=1f6b99740895bb3ea60a686320f8ca29484003c51c580168f0ecc3986b95b5bd.Q.hmb[url;GET;("applicaition/json \r\nX-MBX-APIKEY: 111";())]
I get this as the response:
"{\"code\":-2014,\"msg\":\"API-key format invalid.\"}"
the curl command that works is the following
curl -v -H "X-MBX-APIKEY: 111" -X GET "https://api.binance.com/api/v3/account?timestamp=1521739838&recvWindow=5000000000000&signature=aa5dcf2fcde493cf8b2dacc93812c8eb907f91ded79f043f60e0285ba3a756e9"
Any idea of where im going wrong here?
if you look closely at the result of the curl command, you’ll note the same error:
$ curl -H “X-MBX-APIKEY: 111” “https://api.binance.com/api/v3/account?timestamp=1521739838&recvWindow=5000000000000&signature=aa5dcf2fcde493cf8b2dacc93812c8eb907f91ded79f043f60e0285ba3a756e9”
{“code”:-2014,“msg”:“API-key format invalid.”} $
Hi there,
It looks like the code you posted for adding a custom HTTP header is all correct, I think it’s likely that you are indeed using an invalid API key, assuming you’re using a correct format key when trying to run the request (and that 111 is just acting as a placeholder).
Apologies to not be of more help,
Joseph
the custom header “Content Type:applicaition/json” is misspelt
and isn’t really the type of the GET request