{"record":{"id":"9346b17a4ff12285","repo":"FlowiseAI/Flowise","slug":"url-is-required-for-post-request","errorCode":null,"errorMessage":"URL is required for POST request","messagePattern":"URL is required for POST request","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/tools/RequestsPost/core.ts","lineNumber":110,"sourceCode":"            method: 'POST',\n            headers: args?.headers || {}\n        }\n        super(toolInput)\n        this.url = args?.url ?? this.url\n        this.headers = args?.headers ?? this.headers\n        this.body = args?.body ?? this.body\n        this.maxOutputLength = args?.maxOutputLength ?? this.maxOutputLength\n        this.bodySchema = args?.bodySchema\n    }\n\n    /** @ignore */\n    async _call(arg: any): Promise<string> {\n        const params = { ...arg }\n\n        try {\n            const inputUrl = this.url\n            if (!inputUrl) {\n                throw new Error('URL is required for POST request')\n            }\n\n            let inputBody = {\n                ...this.body\n            }\n\n            if (this.bodySchema && params.body && Object.keys(params.body).length > 0) {\n                inputBody = {\n                    ...inputBody,\n                    ...params.body\n                }\n            }\n\n            const requestHeaders = {\n                'Content-Type': 'application/json',\n                ...(params.headers || {}),\n                ...this.headers\n            }","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/tools/RequestsPost/core.ts#L92-L128","documentation":"Thrown by RequestsPost_Core._call when this.url is falsy at invocation time. The POST tool needs a target URL before it can send a body. It aborts before constructing request headers or the JSON body.","triggerScenarios":"Constructing the tool without a `url` field and invoking it; a flow variable bound to the URL resolving to empty; programmatic use with an empty options object.","commonSituations":"RequestsPost node in the canvas has a blank URL; webhook/API URL env var not set; template placeholder for the URL did not resolve at runtime.","solutions":["Supply `url` in the constructor: `new RequestsPost_Core({ url: 'https://...' })`.","Confirm the Flowise RequestsPost node has a non-empty URL and that bound variables resolve.","Pre-validate at the orchestration layer and skip the call when no URL is configured."],"exampleFix":"// before\nconst tool = new RequestsPost_Core({ body: { x: 1 } } as any)\nawait tool._call({}) // throws: URL is required for POST request\n\n// after\nconst tool = new RequestsPost_Core({ url: 'https://api.example.com/items', body: { x: 1 } } as any)\nawait tool._call({})","handlingStrategy":"validation","validationCode":"function assertPostToolReady(tool: any, body?: unknown) {\n  if (!tool.url || !/^https?:\\/\\//.test(tool.url)) throw new Error('RequestsPost requires a valid http(s) url')\n  if (body !== undefined && typeof body !== 'object') throw new Error('RequestsPost body must be an object')\n}\nassertPostToolReady(tool)\nawait tool._call({})","typeGuard":"const hasValidPostConfig = (t: any): t is { url: string; body?: object } =>\n  typeof t?.url === 'string' && /^https?:\\/\\//.test(t.url) && (t.body === undefined || typeof t.body === 'object')","tryCatchPattern":"try {\n  assertPostToolReady(tool)\n  return await tool._call({})\n} catch (e) {\n  if (/URL is required/.test((e as Error).message)) throw new Error('RequestsPost not configured: set the URL')\n  throw e\n}","preventionTips":["Require URL as a typed constructor parameter in a factory function.","Validate body is serializable (no circular refs) before _call.","Mark the URL field required in the Flowise node."],"tags":["http","post","configuration","validation"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}