diff --git a/src/Api.php b/src/Api.php index 1ca9828..419afa7 100644 --- a/src/Api.php +++ b/src/Api.php @@ -494,7 +494,10 @@ class Api private function delete(string $url, string $error): void { - $response = $this->http()->delete($this->url.$url); + $response = $this->http()->withHeaders([ + 'content-type' => 'application/json', + 'accept' => 'application/json', + ])->delete($this->url.$url); if (null === $response->json()) { $this->exception($error, $url, []); diff --git a/src/Fakes/MembershipFake.php b/src/Fakes/MembershipFake.php index 0f52c50..7f67a75 100644 --- a/src/Fakes/MembershipFake.php +++ b/src/Fakes/MembershipFake.php @@ -176,7 +176,7 @@ class MembershipFake extends Fake { $url = "https://nami.dpsg.de/ica/rest/nami/zugeordnete-taetigkeiten/filtered-for-navigation/gruppierung-mitglied/mitglied/{$memberId}/{$membershipId}"; Http::assertSent(function ($request) use ($url) { - return $request->url() === $url && 'DELETE' === $request->method(); + return $request->hasHeader('content-type', 'application/json') && $request->hasHeader('content-type', 'application/json') && $request->url() === $url && 'DELETE' === $request->method(); }); }