Claudio Villaschi 0 Posted May 27, 2020 (edited) In my microservice I need to retrieve a complete list of all the received header params name for each request. On the TWebRequest there is a complete list for the received query and path params, but not for the header params. It is possible to retrieve a complete list? If yes, how? Thank you in advance. Edited May 28, 2020 by Claudio Villaschi Share this post Link to post
Andrea Magni 75 Posted June 30, 2020 Hi @Claudio Villaschi, sorry for the late. There are some limitations with Indy and enumerating request headers. I am trying to improve the current support as much as possible. Follow this: https://github.com/andrea-magni/MARS/issues/95 Sincerely, Andrea Share this post Link to post
Andrea Magni 75 Posted June 30, 2020 I've added a hack (accessing a protected field of TIdHTTPAppRequest casting a reference to TWebRequest to a subclass) that seems (and should reasonably) work. The hack only relates to those deployment methods where Indy is not letting me access the TWebRequestInfo data structure (Apache modules, IIS ISAPI, Windows Service). From now on, you can use the GetHeaderParamCount, GetHeaderParamValue, GetHeaderParamIndex methods of IMARSRequest interface. uses MARS.Core.RequestAndResponse.Interfaces; // in your resource definition or as a method argument [Context] FReq: IMARSRequest; Let me know if this is enough. Feel free to reopen issue #95 if needed. Sincerely, Andrea Share this post Link to post