web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Access request headers in X++ exposed service endpoints

(0) ShareShare
ReportReport
Posted on by 103

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?

I have the same question (0)
  • MadsK Profile Picture
    15 on at

    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.

  • Suhail Ismail Profile Picture
    103 on at

    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;

  • MadsK Profile Picture
    15 on at

    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 :)

  • Suhail Ismail Profile Picture
    103 on at

    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.

  • MadsK Profile Picture
    15 on at

    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.

  • Martin Dráb Profile Picture
    239,029 Most Valuable Professional on at

    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.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 617

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 461 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 298 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans