Jump to content

Recommended Posts

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 by Claudio Villaschi

Share this post


Link to post

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×