Discuss this help topic in SecureBlackbox Forum

HTTPS: Prepare and send the response

To create response headers you instantiate (or use the pre-created instance of) TElHTTPServerResponseParams class and populate its properties. Once ready, you send the response using TElHTTPSServer.SendResponseHeaders() method. You will need to pass both the request parameters (the instance of TElHTTPServerRequestParams which has been received in OnRequestHeadersReceived event handler) and response parameters (the instance of TElHTTPServerResponseParams) to SendResponseHeaders() method.

If you have the response data to send, you can send them using TElHTTPSServer.SendResponseData() method. This method must be called after SendResponseHeaders() method, and it can be called multiple times until all the data is sent. To let the client know the length of the data it has to expect, you need to either set TElHTTPServerResponseParams.ContentLength property or (for HTTP 1.1 only) use chunked encoding.

When you are done sending the response, call TElHTTPSServer.ResponseComplete() method.

If keep-alives are not used, you can close both server and the connection. If keep-alives are expected and supported, your code can wait for the next request from the client.

How To articles about server-side HTTPS questions

Discuss this help topic in SecureBlackbox Forum