On the one hand, I have a remote Drupal 8 (8.8.1) that is operated via HTTPS and has the following endpoint:
MODULENAME.get_notify: path: 'MODULENAME/get-notify' defaults: _controller: 'DrupalMODULENAMEControllerMODULENAMEApiController::get_notify' _title: 'Get notification' methods: (POST) requirements: _access: 'TRUE'
On the client side, I have a Drupal 8 (8.8.2), which is provided via HTTPS and sends a notification via the Guzzle library. This Drupal is local to my computer and is provided via DDEV. Here is the Guzzle petition, which is in a custom module:
$options = ( 'headers' => ('Content-Type' => 'application/json'), 'json' => $jsonArray, 'timeout' => 15, ); $response = $this->httpClient->post($url, $options);
The system works well, except that when running PHPUnit tests (BrowserTestBase) on the affected module, the POST query always returns the following error:
Client error: `POST https://SERVER_DOMAIN/MODULENAME/get-notify` resulted in a `403 Forbidden` response'
Any idea why I'm getting this error message?