I am using node js server on my local environment, I have tested the APIs with postman and it is working as expected. Now I am working on creating front-end with the help on react js. I am having trouble with Axios.get method with parameters. As it is not returning the same error as it does with postman. I am sending data in x-www-form-urlencoded in postman , and this is what i am trying to achieve with Axios in react js.
let config = {
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
params: {
eth_wallet: this.state.deposit_address
},
}
axios.get(methods.verify_eth_transaction, config)
.then((result)=>{
console.log(result)
})
.catch((err)=>{
console.log(err)
})
I have also tried
axios.get(methods.verify_eth_transaction, qs.stringify(this.state.deposit_address), config)
.then((result)=>{
console.log(result)
})
.catch((err)=>{
console.log(err)
})
It should return "Unable to find a deposit. Please try again." as it is in postman get call. But it is returning "Wallet not found", making me believe that there is something wrong with the way i am sending parameters in my request.
And this is how my node server use the parameters.
Bridge.find({ eth_wallet: { $in: req.body.eth_wallet } }, (err, account) => {
//
//
})