NSURLErrorDomain Code=-1001 iOS Origin: On your device OSI layer 7 · Application Last updated 15 Oct 2026

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.

Exact message you may see NSURLErrorDomain Code=-1001The request timed out
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

  1. Use the Mac’s LAN IP or a tunnel when testing on device
  2. Raise timeoutIntervalForRequest for slow endpoints
  3. Make long operations asynchronous on the server

Detailed fix by platform

Swift

  1. swift
    var request = URLRequest(url: url)
    request.timeoutInterval = 120

How to diagnose

  1. Host — Reachable from the device?
  2. Server — Response time
  3. 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:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

2006 — MySQL ERROR 2006 (HY000): MySQL server has gone away (MySQL)20062013 — MySQL ERROR 2013 (HY000): Lost connection to MySQL server during query (MySQL)2013408 — HTTP 408 Request Timeout (HTTP)408499 — HTTP 499 Client Closed Request (Nginx) (HTTP)499522 — Cloudflare Error 522: Connection Timed Out (Cloudflare)522App Transport Security has blocked a cleartext HTTP load — iOS: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection (NSURLErrorDomain -1022) (Flutter / Dart)App Transport Securit…CannotPullContainerError — ECS task stopped: CannotPullContainerError: pull image manifest has been retried ... / ref pull has been retried (AWS)CannotPullContainerEr…Cleartext HTTP traffic not permitted — Flutter (Android): java.io.IOException: Cleartext HTTP traffic to api.example.com not permitted (Flutter / Dart)Cleartext HTTP traffi…NSURLErro…

Explore the map of this error Full error map →

🧠 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.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.