Skip to content

HTTP 请求节点常见问题#

¥HTTP Request node common issues

以下是 HTTP 请求节点 的一些常见错误和问题,以及解决或故障排除步骤。

¥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:

  • 你在查询参数中使用了无效的名称或值。

¥You're using an invalid name or value in a Query Parameter.

¥You're passing array values in a Query Parameter but the array isn't formatted correctly. Try using the Array Format in Query Parameters option.

查阅你所用服务的 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,查找诸如缺少引号、逗号过多或过少、数组格式错误、方括号或大括号过多或过少等错误。

¥Test your JSON in a JSON checker or syntax parser to find errors like missing quotation marks, extra or missing commas, incorrectly formatted arrays, extra or missing square brackets or curly brackets, and so on.

  • 如果你在节点中使用了表达式,请确保将整个 JSON 用双大括号括起来,例如:

¥If you've used an Expression in the node, be sure you've wrapped the entire JSON in double curly brackets, for example: {{ { "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 密钥或账户可以执行你选择的操作。

¥Update permissions or scopes so that your API key or account can perform the operation you've selected.

  • 以不同的方式格式化你的通用凭据。

¥Format your generic credential in a different way.

  • 生成具有相应权限或范围的新 API 密钥或令牌

¥Generate a new API key or token with the appropriate permissions or scopes.

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.

  1. 在“HTTP 请求”节点中,选择“添加选项”>“批处理”。

¥In the HTTP Request node, select Add Option > Batching. 2. 将“每批次项目数”设置为每个请求中包含的输入项目数。

¥Set Items per Batch to the number of input items to include in each request. 3. 设置“批处理间隔(毫秒)”以在请求之间引入延迟(以毫秒为单位)。例如,要每秒向 API 发送一个请求,请将“批处理间隔 (毫秒)”设置为 1000

¥Set Batch Interval (ms) to introduce a delay between requests in milliseconds. For example, to send one request to an API per second, set Batch Interval (ms) to 1000.

失败时重试#

¥Retry on Fail

使用此选项可在尝试失败后重试节点。

¥Use this option to retry the node after a failed attempt.

  1. 在“HTTP 请求”节点中,转到“设置”并启用“失败时重试”。

¥In the HTTP Request node, go to Settings and enable Retry on Fail. 2. 将“最大重试次数”设置为 n8n 重试节点的最大次数。

¥Set Max Tries to the maximum number of times n8n should retry the node. 3. 将“重试间隔(毫秒)”设置为重试之间的所需延迟时间(以毫秒为单位)。例如,要在重试请求前等待一秒钟,请将“重试间隔 (毫秒)”设置为 1000

¥Set Wait Between Tries (ms) to the desired delay in milliseconds between retries. For example, to wait one second before retrying the request again, set Wait Between Tries (ms) to 1000.