RSS Feed/News Modifying webhook request options requires overwriting entire method

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
20,020
Points
823

Reputation:

Changing the options for sending a webhook request currently requires overwriting whole method run

Could the code to set the options be moved to its own method, eg. smth. like

PHP:

Code:
protected function getRequestOptions(Webhook $webhook): array
{
    $options['headers'] = [
        'XF-Content-Type' => $this->data['content_type'],
        'XF-Webhook-Event' => $this->data['event'],
        'XF-Webhook-Id' => $webhook->webhook_id,
    ];

[...]

return $options;
}
?

This...

Read more

Continue reading...
 
Status
Not open for further replies.
Top