Error Domain=NSURLErrorDomain Code=-1001 "The request timed out."
The server didn’t respond within URLSession’s timeout (60 s default) — slow server, unreachable host on this network, or a stalled connection.
Seen on:
iOS
Meaning
Local dev servers addressed as localhost from a device (localhost is the phone), firewalls, IPv6-only networks, or a long backend operation cause timeouts.
Common causes
- Server slow or overloaded
- Device calling localhost/127.0.0.1 (points to the phone)
- Firewall/VPN blocking
- Long-running request without streaming/polling
⚡ Quick fix
- Use the Mac’s LAN IP or a tunnel when testing on device
- Raise timeoutIntervalForRequest for slow endpoints
- Make long operations asynchronous on the server
Detailed fix by platform
Swift
- swift
var request = URLRequest(url: url) request.timeoutInterval = 120
How to diagnose
- Host — Reachable from the device?
- Server — Response time
- Network — Works on Wi-Fi vs cellular?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in iOS
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026