Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have a problem fetching record from API using Axios. #20

Open
abdojulari opened this issue Feb 5, 2019 · 0 comments
Open

I have a problem fetching record from API using Axios. #20

abdojulari opened this issue Feb 5, 2019 · 0 comments

Comments

@abdojulari
Copy link

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);
     });
 }

screenshot 2019-02-05 at 1 52 32 pm
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant