opsway / react-native-paytm

Unofficial React Native wrapper for PayTM iOS/Android SDK
10 stars 10 forks source link

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

Open Binishatk opened 4 years ago

Binishatk commented 4 years ago

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 commented 4 years ago

How is this relates to Paytm?

girish54321 commented 3 years ago

@Binishatk try using axios.