Update webhook request to use POST method with JSON payload

Modify the webhook integration to send data via POST request with a JSON payload, resolving a "400 Request Header Or Cookie Too Large" error caused by excessive custom headers.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: cfbfe47c-0c9a-4ebf-8a41-2937407eccff
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/cfbfe47c-0c9a-4ebf-8a41-2937407eccff/7RlGXpp
This commit is contained in:
michaelschal committed 2025-09-03 13:01:12 +00:00
1 parent 7a37fcacbd
commit 6ce9ec90a4
3 files changed
+5 -8

No files matched your search

+4 -7
View File
@@ -149,17 +149,14 @@ export async function registerRoutes(app: Express): Promise<Server> {
const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), 60000); // 60 secondes
console.log('🌐 BAP: Envoi vers webhook n8n (GET)...');
console.log('🌐 BAP: Envoi vers webhook n8n (POST avec body JSON)...');
const response = await fetch(webhookUrl, {
method: 'GET',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-PDF-Base64': pdfBase64,
'X-Recipient': recipient,
'X-FileName': fileName,
'X-FileSize': fileBuffer.length.toString()
'Content-Type': 'application/json'
},
body: JSON.stringify(webhookPayload),
signal: controller.signal
});