Skip to content

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

@Binishatk

Description

@Binishatk

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions