Hi, Ive made an API for a specific device and I need to return just a “1” or a “0”.
The problem is that when I do
$this->request = $this->request->withStringBody(‘1’);
return $this->request;
the response has headers that I can’t process on my device, like these ones:
- ‘Content-Encoding’: ‘gzip’
- ‘Content-Length’: 21 (it should be 1, I’m only returning a single character)
- ‘Vary’
- ‘Upgrade’
Ive tried using
$this->response = $this->response->withoutHeader(‘Content-Encoding’);
with no success since it removes the header from the response (at least is what I see using debug()) but the response that I get on postman has that Content-Encoding.
What am I doing wrong? Thanks in advance.
pd: I’m able to modify the header using
$this->response = $this->response->withHeader(‘Content-Encoding’, 0);
$this->response = $this->response->withHeader(‘Vary’, 0);
$this->response = $this->response->withHeader(‘Upgrade’, 0);
but I can’t remove it