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 :
Small and medium business | Business Central, N...
Answered

Http-Status 400 Bad Request due to long "correlation-context"-header at requests with HttpClient

(6) ShareShare
ReportReport
Posted on by 16

For our AL add-ons, we use some external services with REST endpoints. The requests are executed natively via Microsoft’s implementation of the HttpClient type.

For some requests, we receive an HTTP status 400 “Bad Request”.
In one case, the request even worked as an interactive process, but the same request returned “Bad Request” when executed via a job queue entry.

After some research, it became clear that the cause is the sometimes very long "correlation-context" header, which—when sending via HttpClient—appears to be injected by Microsoft before the request is sent.
It contains information about the context of the call, including the client, the object, parameters related to job queue entries, IDs, etc. Therefore, its length can vary. In a SaaS environment, it's even longer.

Some of the REST endpoints seem to have a length limit for HTTP headers. For example, if a header is longer than 300 characters, a “Bad Request” is returned. If the header is shorter, the request goes through.
We were able to reproduce this using Postman.

And now the actual question:
Is it possible to prevent this automatic injection of the "correlation-context" header? Or is there a publisher/hook that allows removing the header again before sending?

Thanks for any hints.
I have the same question (0)
  • Suggested answer
    Dhiren Nagar Profile Picture
    2,685 Super User 2026 Season 1 on at
    Hi,
     
    You can use HttpClient and HttpHeaders to remove certain Headers which you do not want to send as a request.
     
  • JH-12010934-0 Profile Picture
    16 on at
    Hi,
     
    thank you for the answer.
    Yes, I know. But unfortunately this header is not removable, because it is injected by the platform after I give the HttpClient.Send(...) command.
    I don't set this header and I tried to remove it with HttpHeaders.Remove('correlation-context'); That doesn't work.
  • Verified answer
    Assisted by AI
    OussamaSabbouh Profile Picture
    11,005 Super User 2026 Season 1 on at
    Hello ,
    No, you can’t disable or remove the automatically injected correlation-context header in Business Central SaaS. The platform adds it right before sending the request, and there’s no AL hook or publisher to intercept or strip it. If an external REST endpoint rejects long headers (like 300 chars), the only practical solutions are fixing the endpoint to accept longer headers or calling it via a proxy (e.g., Azure API Management / Function) that removes the header before forwarding. This is expected BC SaaS behavior.
    Regards,
    Oussama Sabbouh
  • Suggested answer
    YUN ZHU Profile Picture
    98,014 Super User 2026 Season 1 on at
    As far as I know, there's no way to remove it; some parameters can be overridden, but not all.
    You could submit this idea to Microsoft.
    Missing a feature? Post or vote for ideas on: aka.ms/BCIdeas
    Thanks.
    ZHU

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,091 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,032 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 946 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans