FIX webhook must send POST in body. Add WEBHOOK_POST_SEND_DATA_IN_BODY

for this.
This commit is contained in:
Laurent Destailleur
2024-09-27 16:11:00 +02:00
parent 5e41287ebc
commit 364bef7f79

View File

@@ -101,7 +101,11 @@ class InterfaceWebhookTriggers extends DolibarrTriggers
//'Accept: application/json'
);
$response = getURLContent($tmpobject->url, 'POST', $jsonstr, 1, $headers, array('http', 'https'), 2, -1);
$method = 'POST';
if (getDolGlobalString('WEBHOOK_POST_SEND_DATA_IN_BODY')) {
$method = 'POSTALREADYFORMATED';
}
$response = getURLContent($tmpobject->url, $method, $jsonstr, 1, $headers, array('http', 'https'), 2, -1);
if (empty($response['curl_error_no']) && $response['http_code'] >= 200 && $response['http_code'] < 300) {
$nbPosts++;