Issue with HttpClient Returning 400 Error for XML Request

Hi there, not sure if this is the place to ask, but I'm facing an issue with the HttpClient for an XML request and I feel like I'm missing something obvious.

Here is using Deno's fetch implementation, which works as expected:
const data = await fetch(
  url,
  {
    method: "POST",
    headers: {
      host: hostUrl
      "content-type": "text/xml; charset=utf-8",
      "soapaction": `http://tempuri.org/${name}`,
    },
    body: xml,
  },
);


And here it is, using platform's HTTP Client :
Effect.gen(function*() {
        const httpClient = (yield* HttpClient.HttpClient).pipe(HttpClient.followRedirects, HttpClient.filterStatusOk);
        const response = yield* httpClient.post(
              baseUrl,
              {
                headers: {
                  "host": hostUrl,
                  "content-type": "text/xml; charset=utf-8",
                  "soapaction": `http://tempuri.org/${name}`,
                },
                body: xml,
              },
            );
       ...
})

And this one is always returning a 400 Error from the server, unfortunately with an empty message (I have no access to this service's backend).

I've debugged that the XML body is exactly the same. double checked every header. Everything looks the same. I thought it could be the HTTP version or something but the fact that the raw fetch version is working as expected is odd. Of course, I could not use HttpClient for this, but I want to understand what am I doing wrong. Thanks
Was this page helpful?