FlowiseAI/Flowise · error · Error

HTTP Error ${res.status}: ${res.statusText}

Error message

HTTP Error ${res.status}: ${res.statusText}

What it means

Thrown inside the try block of RequestsPost_Core._call when secureFetch returns a non-ok response. Reports status code and status text. Like 481, this throw is always re-caught by the surrounding catch (485) and re-wrapped as 'Failed to make POST request: HTTP Error <status>: <text>'.

Source

Thrown at packages/components/nodes/tools/RequestsPost/core.ts:137

                    ...inputBody,
                    ...params.body
                }
            }

            const requestHeaders = {
                'Content-Type': 'application/json',
                ...(params.headers || {}),
                ...this.headers
            }

            const res = await secureFetch(inputUrl, {
                method: 'POST',
                headers: requestHeaders,
                body: JSON.stringify(inputBody)
            })

            if (!res.ok) {
                throw new Error(`HTTP Error ${res.status}: ${res.statusText}`)
            }

            const text = await res.text()
            return text.slice(0, this.maxOutputLength)
        } catch (error) {
            throw new Error(`Failed to make POST request: ${error instanceof Error ? error.message : 'Unknown error'}`)
        }
    }
}

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Read the wrapped message suffix to get the real status code, then act on it.
  2. For 400/422, verify the body shape matches the API contract.
  3. For 401/403, provide correct credentials in `headers`.
  4. For 429/5xx, retry with backoff from the caller.

Example fix

// before
if (!res.ok) throw new Error(`HTTP Error ${res.status}: ${res.statusText}`)

// after (include response body for debuggability)
if (!res.ok) {
  const detail = await res.text().catch(() => '')
  throw new Error(`POST ${inputUrl} failed: ${res.status} ${res.statusText} — ${detail.slice(0, 500)}`)
}
Defensive patterns

Strategy: retry

Validate before calling

async function safePost(tool: any, arg: any, maxRetries = 3) {
  for (let attempt = 0; attempt <= maxRetries; attempt++) {
    try { return await tool._call(arg) }
    catch (e) {
      const m = (e as Error).message.match(/HTTP Error (\d{3})/)
      const code = m ? Number(m[1]) : 0
      const transient = code === 429 || (code >= 500 && code < 600)
      if (!transient || attempt === maxRetries) throw e
      await new Promise((r) => setTimeout(r, 2 ** attempt * 500))
    }
  }
}

Type guard

const isClientError = (e: unknown): boolean => {
  const m = (e instanceof Error ? e.message : String(e)).match(/HTTP Error (\d{3})/)
  return !!m && Number(m[1]) >= 400 && Number(m[1]) < 500 && Number(m[1]) !== 429
}

Try / catch

try { return await tool._call(arg) }
catch (e) {
  const code = ((e as Error).message.match(/HTTP Error (\d{3})/) || [])[1]
  if (code === '400' || code === '422') throw new Error('POST body rejected by server — check schema')
  if (code === '409') throw new Error('Conflict — resource state changed')
  throw e
}

Prevention

When it happens

Trigger: Server rejects the POST: 400 bad body, 401/403 auth, 404 wrong path, 409 conflict, 422 validation error, 5xx server fault, 429 rate limit.

Common situations: JSON body schema mismatch with the API; missing Content-Type or auth header; wrong endpoint; upstream service degraded; payload exceeds server limits.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/60b2f23fd0c8a12d. Report an issue: GitHub.