examples
examples copied to clipboard
I have a problem fetching record from API using Axios.
I have trouble doing this as I am very new to react and react native. I am trying to use axios to fetch record from API. I have attached the POSTMAN screenshot. The first issue I have is the grant_type in the body of the postman and second is how to change the username and password to accept the inputs from the user. `componentDidMount(){ const data={ grant_type: 'password', client_id:'RxPadApp', username: this.state.username, password: this.state.password,
}
axios.post('http://192.168.210.159:3000/api/2019/token',
data
)
.then((response)=>{
console.log(response);
}).catch((error)=>{
console.log(error);
});
}
`