REST request doesn't contain body

I’m new to HA and have created a switch (and sensor but that’s not relevant) using a Pi Pico W and exposed the control for the switch via a simple RESTful api. The Api endpoint is /relay and it consumes a POST request with a simple http body of either 0 for off or 1 for on. The api has been tested using a browser and Postman and it works as expected.

I’ve added the switch in HA config (see below) and the first time I use the switch it sends the expected body but subsequent uses always send an empty body. Interestingly, the content-length header is always accurate!

Please help if you can!

HA config for switch:

switch:
  - platform: rest
    resource: http://192.168.56.210/relay
    method: POST
    verify_ssl: false
    name: Heating
    headers:
      Content-type: text/plain
    body_on: 1
    body_off: 0 
    is_on_template: "{{ value_json.active}}"

The received requests, sucessful and failed in that order:

{'headers': {'User-Agent': 'HomeAssistant/2023.11.1 httpx/0.25.0 Python/3.11', 'Content-type': 'text/plain', 'Connection': 'keep-alive', 'Accept-Encoding': 'gzip, deflate, br', 'Host': '192.168.56.210', 'Accept': '*/*', 'Content-Length': '1'}, 'http_version': 'HTTP/1.1', 'body': '0', 'path': '/relay', 'method': 'POST'}
0
relay off
HTTP/1.0 200 OK
{'headers': {'User-Agent': 'HomeAssistant/2023.11.1 httpx/0.25.0 Python/3.11', 'Content-type': 'text/plain', 'Connection': 'keep-alive', 'Accept-Encoding': 'gzip, deflate, br', 'Host': '192.168.56.210', 'Accept': '*/*', 'Content-Length': '1'}, 'http_version': 'HTTP/1.1', 'body': '', 'path': '/relay', 'method': 'POST'}

HTTP/1.0 404 Not Found