Repository: mtarld/api-platform-ms-bundle (php)

Issue:
Wrong Accept header for patch requests
`Content-Type` and `Accept` headers are set to the same value for every request (see [GenericHttpClient::request](https://github.com/mtarld/api-platform-ms-bundle/blob/1.x/src/HttpClient/GenericHttpClient.php#L51-L61)). However the response to a `PATCH` request is in the default format (like `application/ld+json`) and not `application/merge-patch+json`. Combined this leads to a 406 status code error when the default format is not `jsonapi`.

The solution to this would be to use the default mime type set up for the microservice for the accept header. I could issue a PR if you don't mind.

Pull request description:
Separate accept from content-type header for patch requests
Fixes #84

Patch:
diff --git a/src/HttpClient/GenericHttpClient.php b/src/HttpClient/GenericHttpClient.php
index d88fd53..956260b 100644
--- a/src/HttpClient/GenericHttpClient.php
+++ b/src/HttpClient/GenericHttpClient.php
@@ -48,14 +48,14 @@ class GenericHttpClient implements ReplaceableHttpClientInterface
      */
     public function request(Microservice $microservice, string $method, string $uri, mixed $body = null, ?string $mimeType = null, ?string $bodyFormat = null): ResponseInterface
     {
-        $defaultMimeType = 'PATCH' === $method ? self::PATCH_MIME_TYPES[$microservice->getFormat()] : self::MIME_TYPES[$microservice->getFormat()];
-        $mimeType ??= $defaultMimeType;
+        $mimeType ??= self::MIME_TYPES[$microservice->getFormat()];
+        $contentType = 'PATCH' === $method ? self::PATCH_MIME_TYPES[$microservice->getFormat()] : $mimeType;
         $bodyFormat ??= $microservice->getFormat();
 
         $options = [
             'base_uri' => $microservice->getBaseUri(),
             'headers' => [
-                'Content-Type' => $mimeType,
+                'Content-Type' => $contentType,
                 'Accept' => $mimeType,
             ],
         ];


Test patch:
diff --git a/tests/HttpRepository/HttpRepositoryTest.php b/tests/HttpRepository/HttpRepositoryTest.php
index fd22250..ba81d49 100644
--- a/tests/HttpRepository/HttpRepositoryTest.php
+++ b/tests/HttpRepository/HttpRepositoryTest.php
@@ -433,7 +433,7 @@ class HttpRepositoryTest extends KernelTestCase
                     'base_uri' => 'https://localhost',
                     'headers' => [
                         'Content-Type' => 'application/merge-patch+json',
-                        'Accept' => 'application/merge-patch+json',
+                        'Accept' => 'application/ld+json',
                     ],
                     'body' => '{"iri":"\/puppies\/1","super_name":"foo","color":null,"hairs":[]}',
                 ]