Comments (11)
Strange. Yep. Default is port 80 for http. 443 for https if you're connecting like that.
Are you running on iOS 9+?
If so, can you check your info.plist for the http exception if you're using http?
https://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/
from apisauce.
thanks for the advise and quick respond @skellock I had setup Per-Domain Exceptions in the info.plist and it works :)
btw actually the log on my first comment was the one from console.log(response) which has no request info, thats why I wonder could be my redux presist thing so I wish that we can also log the request. anyway thanks for the help and good Sauce for apis
from apisauce.
Having the same issue with https and must be something on my AWS API Gateway but it doesn't help to debug when the error is misleading. I have no idea what the actual error is. Don't know if it is axios or apisauce holding back info.
All I get in response is data null, headers null, status null, problem NETWORK_ERORR
EDIT: issue was with my ssl certificate for https, worked fine with postman and on the browser but not in the app. Fixed that and the issue was fixed. Try a curl -v https://www.example.com
if you suspect that is your issue.
from apisauce.
I suspect that is my issue too. How can I fix this?
from apisauce.
Hmm... wrong server name or port? Can you verify you can connect via something like Postman?
from apisauce.
yep, I verified them by postman / Chrome, I assume the default port is 80?
from apisauce.
pretty strange, ok let me check that, also is there a way that I can log the request, since it could also be my redux persist thing
from apisauce.
Ya, you could always console.log(response)
to see what's going on. Perhaps axios might have more information. If you haven't set your transport security exception and you're using iOS 9 + http, then it's pretty much that.
It'd be nice if the network error that came back was a little more descriptive. Depending on the device, sometimes it just says, "Error". Hehe.
from apisauce.
for info, this saves a lot of time : http://www.preslav.me/2017/03/26/debugging-network-calls-in-react-native-using-the-chrome-debugger/
in my case, this was a cors header error
from apisauce.
Came here for an answer and didnt find one, so here was my issue incase it helps anyone:
The internals don't seem to properly handle incorrect payloads - in my case, I was accidentally including a Date object in the payload, and the raw dump of the internal Axios error doesnt give anything away:
AxiosError: Network Error at handleError (192.168.1.105:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&hot=false&lazy=true:154868:39) at call (native) at dispatchEvent (192.168.1.105:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&hot=false&lazy=true:42636:31) at setReadyState (192.168.1.105:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&hot=false&lazy=true:40459:33) at __didCompleteResponse (192.168.1.105:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&hot=false&lazy=true:40245:29) at apply (native) at anonymous (192.168.1.105:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&hot=false&lazy=true:40387:52) at apply (native) at emit (192.168.1.105:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&hot=false&lazy=true:3063:40) at apply (native) at __callFunction (192.168.1.105:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&hot=false&lazy=true:3684:36) at anonymous (192.168.1.105:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&hot=false&lazy=true:3404:31) at __guard (192.168.1.105:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&hot=false&lazy=true:3621:15) at callFunctionReturnFlushedQueue (192.168.1.105:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&hot=false&lazy=true:3403:21)
So the result is this internal throw (with no connection to the server at all) leaving you to figure it out yourself. A malformed payload should not cause a NETWORK_ERROR, so I would classify this as a bug.
from apisauce.
Hello I have an error CLIENT_ERROR : 403 on iOS only that is on the emulator or the phone. I login without any problem. On android it works fine. I need help please.
apisauce : 3.0.1
expo : 49.0.11
RN : 0.72.6
here is the return object :
{"config": {"adapter": ["xhr", "http"], "baseURL": "http://myapi", "data": undefined, "env": {"Blob": [Function Blob], "FormData": [Function FormData]}, "headers": [Object], "maxBodyLength": -1, "maxContentLength": -1, "method": "get", "params": {}, "timeout": 10000, "transformRequest": [[Function transformRequest]], "transformResponse": [[Function transformResponse]], "transitional": {"clarifyTimeoutError": false, "forcedJSONParsing": true, "silentJSONParsing": true}, "url": "/posts?page=1&page_size=10&search=", "validateStatus": [Function validateStatus], "xsrfCookieName": "XSRF-TOKEN", "xsrfHeaderName": "X-XSRF-TOKEN"}, "data": {"detail": "Informations d'authentification non fournies."}, "duration": 699, "headers": {"allow": "GET, POST, HEAD, OPTIONS", "content-language": "fr", "content-length": "58", "content-type": "application/json", "cross-origin-opener-policy": "same-origin", "date": "Tue, 26 Dec 2023 15:37:45 GMT", "referrer-policy": "same-origin", "server": "Microsoft-IIS/10.0", "vary": "Accept, Accept-Language, Cookie, Origin", "x-content-type-options": "nosniff", "x-frame-options": "DENY", "x-powered-by": "ASP.NET"}, "ok": false, "originalError": [AxiosError: Request failed with status code 403], "problem": "CLIENT_ERROR", "status": 403}
from apisauce.
Related Issues (20)
- Cannot read properties of undefined (reading 'status') HOT 7
- Request sends Twice returns HTTP 500 Error HOT 2
- doesn't support formData HOT 4
- How to add file CA Certificate https?
- Question about response type declaration HOT 5
- Vulnerability introduced by package follow-redirects HOT 1
- Do I Need To Set Headers Max-Age?
- is there any schedule to upgrade the axios? HOT 4
- Latest version support for Axios ? HOT 2
- addAsyncRequestTransform not tiggering in iOS
- Remove request/response transform. HOT 1
- got 2 test case failed in unit test HOT 1
- TypeError: axios.create is not a function error HOT 3
- Upload image not working on 3.0.1 HOT 3
- error TypeError: axios.isCancel is not a function HOT 1
- create is not a function HOT 3
- Weird behaviour with urls after updating to Xcode 15 HOT 6
- Is there a way to redo a request if failed?
- axiosInstance doesn't inherit default headers from apisauce
- Singleton concern on addResponseTransform HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apisauce.