So I am setting up a webhook with the Xero API and it expects a blank response with no cookies and gzip etc. I cannot seem to work out how to send a completely blank response.
Here's an example of my response from ngrok:
HTTP/1.1 401 Unauthorized
Server: nginx/1.13.3
Date: Wed, 12 Dec 2018 02:11:07 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
0
Here's the code that executes the HTTP response:
http_response_code(401);
exit;
I've also tried this:
return response(null, 401);
But in the webhook setup panel it shows me this error:
Intent To Receive required
Last attempt at 2018-12-12 02:15:57 UTC
Failed to respond in timely manner
Despite the response time being <0.5s. I've sent a bunch of screen recordings to Xero but their support seem to think it will work.