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

React native Android NETWORK ERROR #6356

Open
stefantanaskovic18 opened this issue Apr 16, 2024 · 1 comment
Open

React native Android NETWORK ERROR #6356

stefantanaskovic18 opened this issue Apr 16, 2024 · 1 comment

Comments

@stefantanaskovic18
Copy link

Describe the bug

const url = https://${server}/api/thisisnotsensitiveinformationbutnoneedtomakeiteasytofind?applicationname=mobileclient;

const axiosConfig = {
method: 'GET',
url,
headers: {
Accept: 'application/json',
'Content-Type': 'application/json;charset=UTF-8',
},
};

try {
console.log('login api params 2', axiosConfig);
const respond = await axios(axiosConfig);

const loginParams = {
  authority: respond.data.authority,
  clientId: respond.data.clientId,
  redirectUrl: respond.data.redirectUrl,
  scopes: respond.data.scopes,
};
return {...loginParams};

} catch (error) {
console.log('THERE IS AN ERROR14', error);
setTimeout(() => {
Alert.alert(
'Error',
'Fejl ved login, der er angivet forkert servernavn eller brugernavn.',
[{text: 'OK', onPress: () => console.log('OK Pressed')}],
);
}, 100);
console.log(error);
throw error;
}

we have this code. Axios config is equal to:
LOG login api params 2 {"headers": {"Accept": "application/json", "Content-Type": "application/json;charset=UTF-8"}, "method": "GET", "url": "https://tso_undervmat.timeviewtest.dk/api/thisisnotsensitiveinformationbutnoneedtomakeiteasytofind?applicationname=mobileclient"}

This code is working fine on iOS but on Android it says AxiosError: Network Error. When I try endpoints without underscore(_) its working fine. Example: https://tsoundervmat.timeviewtest.dk/........
Both are working on iOS and Android but with underscore only on iOS. When I try this endpoint with fetch() its working fine also.
"axios": "^1.6.8",
"react-native": "^0.64.3",
"react": "16.13.1",

To Reproduce

No response

Code snippet

No response

Expected behavior

No response

Axios Version

No response

Adapter Version

No response

Browser

No response

Browser Version

No response

Node.js Version

No response

OS

No response

Additional Library Versions

No response

Additional context/Screenshots

No response

@zain-xcorebit
Copy link

I am facing the same issue.
Any solution on react native level.

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

2 participants