dimanche 8 juillet 2018

Can PHP close the connection to client?

I'm writing a mock webservice, and besides legit responses I also want to generate various error conditions to see how my code responds to them. One of those would be an aborted connection. That is, I want to return NOTHING. Not even HTTP headers, not even the status line. Just brutally close the underlying TCP socket as soon as the request is received. This simulates some catastrophic error in the webservice.

Is this possible at all? Is it possible if my webserver is Apache? What about the built in webserver?

Aucun commentaire:

Enregistrer un commentaire