Notifications
Announcements
No record found.
Hi,
We have exposed an service endpoint from D365 which is used by a client. The client is passing a custom header which they are expecting us to capture and save. Is there any way we can access this header values on the request made?
Did you find a solution for this? I am trying to do something very similar, but I don't see any obvious way to access the http header info for the inbound call.
Yes. I am not a X++ developer, but i had idea that it might be similar to .Net Web APIs. Initially we tried it but where using the wrong namespace and asked the question here. Below is the code to get the request headers.
System.Web.HttpContext::Current.Request.Headers;
You are right. We should still have access to the HttpContext for the request at that point and ought to be able read the headers directly. Thanks for the hint, that should work nicely :)
Hi, we faced an issue with this once we deployed the solution to UAT environment. The HttpContext is null and hence we cannot access the headers.
Yes, that was my conclusion as well. It works fine on Tier 1 environments but it does not on Tier 2+ due to the IIS configuration.
I eventually gave up, and rearchitected the solution to include the header values as part of the contract and then had our Azure layer inject the values into the JSON payload.
Moved from Dynamics 365 General Forum to Dynamics 365 Finance Forum, because X++ is used only by F&O.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 660 Most Valuable Professional
André Arnaud de Cal... 549 Super User 2025 Season 2
Sohaib Cheema 307 User Group Leader