Debug webhook
This commit is contained in:
parent
209bf00b69
commit
f103382935
@ -104,7 +104,7 @@ class InterfaceWebhookTriggers extends DolibarrTriggers
|
|||||||
$actionarray = explode(",", $tmpobject->trigger_codes);
|
$actionarray = explode(",", $tmpobject->trigger_codes);
|
||||||
if (is_array($actionarray) && in_array($action, $actionarray)) {
|
if (is_array($actionarray) && in_array($action, $actionarray)) {
|
||||||
$jsonstr = '{"triggercode":'.json_encode($action).',"object":'.json_encode($object).'}';
|
$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) {
|
if (empty($response['curl_error_no']) && $response['http_code'] >= 200 && $response['http_code'] < 300) {
|
||||||
$nbPosts ++;
|
$nbPosts ++;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -2312,4 +2312,4 @@ ScriptIsEmpty=The script is empty
|
|||||||
ShowHideTheNRequests=Show/hide the %s SQL request(s)
|
ShowHideTheNRequests=Show/hide the %s SQL request(s)
|
||||||
DefinedAPathForAntivirusCommandIntoSetup=Define a path for an antivirus program into <b>%s</b>
|
DefinedAPathForAntivirusCommandIntoSetup=Define a path for an antivirus program into <b>%s</b>
|
||||||
TriggerCodes=Triggerable events
|
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.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user