javascript - Creating wallet on Blockchain with Ajax gives CORS error -
i trying create wallet on blockchain using ajax getting "cross-origin request blocked" error. ajax call is:
$.ajax({ type: 'post', url: 'https://blockchain.info/api/v2/create_wallet', data: "cors=true&email="+email+"&password="+password+"&api_code="+code, datatype:'json', crossdomain: true, beforesend:function(){ }, success: function (data) { } }); when post error cross-origin request blocked: same origin policy disallows reading remote resource @ https://blockchain.info/api/v2/create_wallet. can fixed moving resource same domain or enabling cors.
on blockchain some api calls available cors headers if add cors=true parameter request
i have tried everything, have tried send parameter post parameter, have tried jsonp. have tried header access-control-allow-origin * nothing seems working. can confirm if managed create blockchain wallet using ajax call or don't support cors this. appreciated.
thanks
hamza
i think safe blockchain not support cors wallet api.
your ajax call above looks correct , getting cors blocked error.
and unlike of other apis, blockchain wallet api docs @ https://blockchain.info/api/blockchain_wallet_api not specify calls available via cors cors=true query parameter.
there significant security implications when dealing private keys , passwords in browser using javascript. suspect why not allow it.
Comments
Post a Comment