HTTP 请求节点常见问题(HTTP Request node common issues)#
这里是一些关于 HTTP Request 节点 的常见错误和问题,以及解决或排查它们的步骤。
🌐 Here are some common errors and issues with the HTTP Request node and steps to resolve or troubleshoot them.
请求错误 - 请检查你的参数(Bad request - please check your parameters)#
当节点收到表示请求错误的400错误时,会显示此错误。此错误最常发生的原因是:
🌐 This error displays when the node receives a 400 error indicating a bad request. This error most often occurs because:
- 您在 查询参数 中使用了无效的名称或值。
- 你正在通过 查询参数 传递数组值,但数组格式不正确。试试使用 查询参数中的数组格式 选项。
查阅你所用服务的 API 文档,以格式化你的查询参数。
🌐 Review the API documentation for your service to format your query parameters.
找不到你请求的资源(The resource you are requesting could not be found)#
当你输入的端点 URL 无效时,会显示此错误。
🌐 This error displays when the endpoint URL you entered is invalid.
这可能是由于 URL 中的拼写错误或已弃用的 API。请参考你服务的 API 文档,以确认你拥有有效的端点。
🌐 This may be due to a typo in the URL or a deprecated API. Refer to your service's API documentation to verify you have a valid endpoint.
JSON 参数必须是有效的 JSON(JSON parameter need to be an valid JSON)#
当你传递的参数是 JSON 格式,但格式不正确时,会显示此错误。
🌐 This error displays when you've passed a parameter as JSON and it's not formatted as valid JSON.
要解决此问题,请检查你输入的 JSON 是否存在以下问题:
🌐 To resolve, review the JSON you've entered for these issues:
- 使用 JSON 检查器或语法解析器测试你的 JSON,查找诸如缺少引号、逗号过多或过少、数组格式错误、方括号或大括号过多或过少等错误。
-
如果你在节点中使用了 表达式,请确保已用双大括号将整个 JSON 封装起来,例如:
1 2 3 4 5 6 7 8 9 10 11
{{ { "myjson": { "name1": "value1", "name2": "value2", "array1": ["value1","value2"] } } }}
禁止访问 - 请检查你的凭证(Forbidden - perhaps check your credentials)#
当节点收到 403 错误(表示身份验证失败)时,会显示此错误。
🌐 This error displays when the node receives a 403 error indicating authentication failed.
为了解决此问题,请检查所选的凭据,并确保你能够使用它们进行身份验证。你可能需要:
🌐 To resolve, review the selected credentials and make sure you can authenticate with them. You may need to:
- 更新权限或范围,以便你的 API 密钥或账户可以执行你选择的操作。
- 以不同的方式格式化你的通用凭据。
- 生成具有相应权限或范围的新 API 密钥或令牌
429 - 该服务收到你的请求过多(429 - The service is receiving too many requests from you)#
当节点从你调用的服务收到 429 错误 时,会显示此错误。这通常意味着你已达到该服务的速率限制。你可以在 处理 API 速率限制 页面上了解更多信息。
🌐 This error displays when the node receives a 429 error from the service that you're calling. This often means that you have hit the rate limits of that service. You can find out more on the Handling API rate limits page.
要解决此错误,你可以使用 HTTP 请求节点的内置选项之一:
🌐 To resolve the error, you can use one of the built-in options of the HTTP request node:
批处理(Batching)#
使用此选项可分批发送请求,并在批处理之间添加延迟。
🌐 Use this option to send requests in batches and introduce a delay between them.
- 在 HTTP 请求节点中,选择 添加选项 > 批处理。
- 将 每批项目数 设置为每个请求中包含的输入项目数量。
- 设置 批处理间隔(毫秒) 以在请求之间引入延迟。例如,要每秒向 API 发送一个请求,请将 批处理间隔(毫秒) 设置为
1000。
失败时重试(Retry on Fail)#
使用此选项可在尝试失败后重试节点。
🌐 Use this option to retry the node after a failed attempt.
- 在 HTTP 请求节点中,进入 设置 并启用 失败重试。
- 将 最大尝试次数 设置为 n8n 应重新尝试此节点的最大次数。
- 将 重试间隔(毫秒) 设置为每次重试之间所需的延迟时间(毫秒)。例如,如果要在再次重试请求之前等待一秒钟,请将 重试间隔(毫秒) 设置为
1000。