Hello, I am using web3js for requesting infura.io.
var mainNetHttpHost = ‘https://mainnet.infura.io/v3/MY-PROJECT-ID’;
var mainNetHttpProvider = new web3js.providers.HttpProvider(this.mainNetHttpHost);
mainNetHttp = new web3js(mainNetHttpProvider);
mainNetHttp.eth.getBalance(‘ETH-wallet-addr’);
But I get the error.
Error: Invalid JSON RPC response: “basic auth failure\n”
I tested using postman is success.
What’ wrong?? ㅠ.ㅜ
please help me…
@Sean_Infura@wuehler I’m getting the same issue with just using the curl command… I tried generating a new project key but same error not sure what im missing? Am I suppose to give it the secret key too?
Nevermind… looks like I was using a v2 project (even though the project page said to use v3 it didnt work). I tried with a new project and it finally worked.