简体   繁体   中英

How can I access/modify headers of request/reponses in a Delphi 2010 DataSnap Server

I'm in the process of building a DataSnap Server that functions as WebDAV server and I'm trying to read the request headers when using a DSHTTPService and then modify the response headers.

Can anyone point me in the right direction? I've notice the Trace TDSRequest and TDSResponse are ancestors of TDSRequestIndy and TDSResponseIndy and those components have access to the headers but am not entirely sure how to get from a TDSRequest to TDSRequestIndy.

Also I didn't think that the Trace would be the cleanest way to access the request and response, but it's the only way I've found so far.

The reason for trying to do this with DataSnap and not just straight Indy is that I'm looking to use DataSnap for other remote methods.

也许您应该考虑使用TidHTTPServer并创建一个包含许多事件和方法的indy服务器,而不是从DSHTTPService开始,包括OnBeforeBind,OnAfterBind,OnHeadersAvailable ......,您可以在其中访问标题

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM