GithubHelp home page GithubHelp logo

Comments (11)

skellock avatar skellock commented on August 20, 2024 4

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.

ksaynice avatar ksaynice commented on August 20, 2024 2

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.

hammadzz avatar hammadzz commented on August 20, 2024 1

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.

cretumarius avatar cretumarius commented on August 20, 2024 1

@hammadzz

I suspect that is my issue too. How can I fix this?

from apisauce.

skellock avatar skellock commented on August 20, 2024

Hmm... wrong server name or port? Can you verify you can connect via something like Postman?

from apisauce.

ksaynice avatar ksaynice commented on August 20, 2024

yep, I verified them by postman / Chrome, I assume the default port is 80?

from apisauce.

ksaynice avatar ksaynice commented on August 20, 2024

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.

skellock avatar skellock commented on August 20, 2024

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.

baskan avatar baskan commented on August 20, 2024

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.

uxinnuendo avatar uxinnuendo commented on August 20, 2024

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.

Philip970 avatar Philip970 commented on August 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.