---
title: "Mac 上的 There was a bad response from the server（NSURLErrorDomain -1011）· Kilobat 指南"
url: "https://kilobat.app/zh-hans/guides/nsurl-error-1011-there-was-a-bad-response-from-the-server"
description: "某个 App 显示 There was a bad response from the server，错误 -1011。查看 HTTP 状态，找出是谁发来了错误的应答。"
---

# Mac 上的“There was a bad response from the server”（NSURLErrorDomain -1011）

服务器作出了应答，但应答是错误状态，或者无效。原因通常是服务器出错、密钥有误或代理。

**让你的智能体来解决**拷贝一条提示词，适用于 Claude Code、Codex 或任何能使用终端的智能体。

我的 Mac 出现了这个问题：Mac 上的“There was a bad response from the server”（NSURLErrorDomain -1011）。请阅读 https://kilobat.app/zh-hans/guides/nsurl-error-1011-there-was-a-bad-response-from-the-server.md，并和我一起逐步处理。如果缺少 Kilobat CLI，请安装：brew install seifip/kilobat/kilobat。请你自己运行指南中的终端和 kilobat 检查，并告诉我发现了什么。列出只有我才能完成的步骤。更改任何设置之前先问我。

适用于：macOS 13 Ventura 及更高版本。文本已在 macOS 27.2 的 CFNetwork 中核对。 · 核查日期：2026年10月29日

## 症状

- 某个 App 显示“There was a bad response from the server.”
- 控制台显示 NSURLErrorDomain Code=-1011。
- App 可能会显示 401、403 或 500 之类的状态。

## 可能的原因

- **HTTP 错误状态。**服务器返回了 4xx 或 5xx。
- **登录、密钥或令牌有误。**服务器拒绝了请求。
- **代理或过滤器页面。**网络上的某个设备发来了它自己的应答。
- **服务器故障。**服务出错或达到了限制。

## 如何检查

1. 显示服务器发送的状态码。

   ```
   curl -sS -o /dev/null -w '%{http_code}\n' https://example.com
   ```
2. 请求该页面，并显示连接的每一步。

   ```
   curl -v -o /dev/null https://example.com
   ```

## 如何修复

1. 查看状态码。401 和 403 表示登录或密钥有问题。5xx 表示服务器有问题。
2. 在 App 中重新登录，或者更新密钥或令牌。
3. 换一个网络试试，以排除代理或过滤器。
4. 稍后再试。如果一直失败，请告诉服务的所有者。

## 使用 Kilobat

1. 一步检查 Wi-Fi、路由器、互联网、DNS 和登录页面。

   ```
   kilobat diagnose
   ```
2. 如果某个网站或服务连不上，找出阻断它的环节。

   ```
   kilobat why example.com
   ```
3. CLI 免费。在 App 中，这些检查给出的建议属于 Kilobat Pro。请参阅[找出某个网站或 API 连不上的原因](https://kilobat.app/zh-hans/guides/recipes/why-cant-it-connect)。

## 常见问题

**是 Mac 的问题吗？**

很少是。服务器发来的应答，App 不接受。

**-1011 表示网络故障吗？**

不是。网络是正常的。应答有问题。

## 参考资料

- CFNetwork.framework 中的错误文字，macOS 27.2（Localizable.loctable）
- curl(1) 和 nc(1)，macOS 27.2 自带的 man 手册页

核查日期：2026 年 10 月 29 日。

## 相关指南

- [Mac 上内容过滤器屏蔽了网站](https://kilobat.app/zh-hans/guides/content-filter-blocking): 内容过滤器会检查网页流量并阻止某些网站。
- [Mac 上代理设置导致 App 无法连接](https://kilobat.app/zh-hans/guides/proxy-settings-breaking-apps): 代理设置会让流量经由另一台服务器转发。
- [网站在手机上能打开，在 Mac 上却打不开](https://kilobat.app/zh-hans/guides/site-works-on-phone-not-mac): 网站在手机上能打开、在 Mac 上却打不开时，问题通常出在 Mac 上。
- [Mac 上的“You do not have permission to access the requested resource”（NSURLErrorDomain -1102）](https://kilobat.app/zh-hans/guides/nsurl-error-1102-you-do-not-have-permission-to-access-the-requested-resource): 服务器拒绝了访问。
