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

Cannot access Api using Token using react native, but it is possible using other platform #15

Open
Binishatk opened this issue Feb 29, 2020 · 2 comments

Comments

@Binishatk
Copy link

Binishatk commented Feb 29, 2020

Please help me to find a solution to access api using JWT Token in react native platform.It gives response using postman , html form submission and using android.I faced a problem while ios app integration using react native and give authentication required false response. Here i am attached my api call using react native Android api call give correct response.What are the changes i have to implement in my react native code, Please Help.

API call using React native:-

fetch('http://colorpages.net/erpnew/index.php/api/list/model/categorylist',{

method: 'POST',

headers: {

Accept: 'application/json',
'Content-Type': 'application/json',
'Token':'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IjI4MyIsImxvZ2luZGF0ZSI6IjIwMjUtMDQtMDcgMTE6NTg6NDcifQ.czDlaoEXQzXAK4TDi-7FwxWkE-XoOYvhmpgFxZs9EEk'
},

}).then((response) => response.json())
.then((responseJson) => {
console.log("RES",responseJson)
})
.catch((error) => {
console.error(error);
});

@philly25
Copy link

How is this relates to Paytm?

@girish54321
Copy link

@Binishatk try using axios.

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

3 participants