chkaufmann 17 Posted March 6, 2023 Hi, I have to log each POST request to my TIdHTTPServer to a file. When I look at TIdHttpRequestInfo I don't find a property with the full data sent to my server. Do I have to combine RawHeaders and PostStream in order to get the full request? Is there something else, where data is written to? Is there a method I didn't see in order to get all this information in one block? Regards Christian Share this post Link to post
Remy Lebeau 1436 Posted March 6, 2023 8 hours ago, chkaufmann said: When I look at TIdHttpRequestInfo I don't find a property with the full data sent to my server. Not the raw data as it came directly from the TCP socket, no. By the time you are given access to the TIdHTTPRequestInfo object, all of the raw socket data has already been parsed and re-organized for Indy's purposes. That being said, you can get the (near-raw) headers from the TIdHTTPRequestInfo.RawHeaders property, and the body data from either the TIdHTTPRequestInfo.PostStream or TIdHTTPRequestInfo.FormParams property, depending on the request's media type. 8 hours ago, chkaufmann said: Do I have to combine RawHeaders and PostStream in order to get the full request? Basically, yes. 8 hours ago, chkaufmann said: Is there something else, where data is written to? Is there a method I didn't see in order to get all this information in one block? The only other option is to log the raw socket data immediately as it comes off the socket, before Indy parses it. You can do that by assigning a TIdConnectionIntercept-derived object to the AContext.Connection.Intercept property in the server's OnConnect event. For instance, one of the TIdLog... components, like TIdLogFile, 2 Share this post Link to post