Http requests send Transfer-Encoding: chunked together with Content-Length, breaking requests to strict servers

Hi Tape Community,

I would like to report an observed bug when sending http requests from tape. I will focus on my main issue, which is http.post, although I have observed the same behavior with other methods:

Short description

In an Execute Script automation, http.post(url, { data: <object> }) transmits the request with both Transfer-Encoding: chunked and Content-Length headers at once. Per RFC 7230 ยง3.3.3 a message must not contain both. Lenient endpoints ignore the conflict, but strict servers (in our case nginx + PHP-FPM) read an empty body, so all body parameters arrive missing โ€” even though the body itself is fully correct.

Impact

The request body is transmitted correctly (visible at any echo endpoint), but strict servers reject the framing and the application receives no parameters. The resulting errors look like payload problems, not transport problems, which made this very hard to diagnose. To be clear: this is a transport-layer framing report, not a request-formatting question.

Steps to reproduce

  1. Send a POST with an object body to an echo endpoint:
   await http.post("https://<echo-endpoint>", {
     headers: { "Content-Type": "application/json" },
     data: { hello: "world", nested: { a: 1 } }
   });
  1. Inspect the received headers.

Observed: request arrives with both Transfer-Encoding: chunked and Content-Length. Against nginx/PHP-FPM the body is empty.

Expected: a single unambiguous framing โ€” Content-Length only, no Transfer-Encoding (matching a standard cURL POST).

Workaround

Setting Content-Length explicitly removes the Transfer-Encoding: chunked header and makes the request succeed:

const reqBody = { hello: "world", nested: { a: 1 } };

await http.post("https://<echo-endpoint>", {
  headers: {
    "Content-Type": "application/json",
    "Content-Length": String(Buffer.byteLength(JSON.stringify(reqBody)))
  },
  data: reqBody
});

An identical request that previously failed (server reporting missing parameters) then returned HTTP 200.

Evidence

Same logical request, same echo endpoint, two clients:

  • Tape http.post (object body): headers included transfer-encoding: chunked and content-length.
  • cURL: content-length only, no transfer-encoding โ€” and this one succeeded against the target server.

I have observed the same behavior in both Execute Script and Send HTTP Request automations, with POST, PUT and PATCH methods, which might hint to an underlying issue with how Tape seems to be dealing with http requests. http.upload works as expected (content-length only).

Please let me know if you need any additional information to reproduce this issue and thank you in advance for your support!