Debug webhook

This commit is contained in:
Laurent Destailleur 2022-09-13 00:16:38 +02:00
parent 209bf00b69
commit f103382935
2 changed files with 2 additions and 2 deletions

View File

@ -104,7 +104,7 @@ class InterfaceWebhookTriggers extends DolibarrTriggers
$actionarray = explode(",", $tmpobject->trigger_codes);
if (is_array($actionarray) && in_array($action, $actionarray)) {
$jsonstr = '{"triggercode":'.json_encode($action).',"object":'.json_encode($object).'}';
$response = getURLContent($tmpobject->url, 'POST', $jsonstr);
$response = getURLContent($tmpobject->url, 'POST', $jsonstr, 1, array(), array('http', 'https'), 0, -1);
if (empty($response['curl_error_no']) && $response['http_code'] >= 200 && $response['http_code'] < 300) {
$nbPosts ++;
} else {

View File

@ -2312,4 +2312,4 @@ ScriptIsEmpty=The script is empty
ShowHideTheNRequests=Show/hide the %s SQL request(s)
DefinedAPathForAntivirusCommandIntoSetup=Define a path for an antivirus program into <b>%s</b>
TriggerCodes=Triggerable events
TriggerCodeInfo=Enter here the list of trigger codes that must generate a post of a web request
TriggerCodeInfo=Enter here the trigger code(s) that must generate a post of a web request (only external URL are allowed). You can enter several trigger codes separated by a comma.