Skip to content
Menu
Jeremy Vyska
  • Now
  • Stuff
    • Timeline
    • Past Talks
    • Contact
  • Articles
Jeremy Vyska
Upset looking child, covering his mouth, looking scared of a piece of broccoli on a fork, being presented like a parent feeding the child. Child captioned "Picky API". Broccoli captioned "Extra .NET Headers"

HTTP Requests from Business Central – Expect 100-Continue

Posted on 2021-10-24

I doubt this will have a very wide audience who need this, but I wanted to write it up for the future sanity of somebody.

I was creating a Business Central Extension that needed to call a POST API call to a very very picky API endpoint – if there were unexpected headers, failure.

Upset looking child, covering his mouth, looking scared of a piece of broccoli on a fork, being presented like a parent feeding the child. Child captioned "Picky API". Broccoli captioned "Extra .NET Headers"
Honestly, I’m annoyed with everyone involved here.

So, I was frustrated to realize that Business Central was automagically adding a new HttpHeader on sending the request, “Expect” with a value of “100-continue”. Digging into things, this header is automatically added during the send process, so no level of trying to change the HTTP Headers was going to help me.

Thanks to this ancient post from 2004 about HttpWebRequests with .NET, I at least had the info above to work with. Deep in the comments was a pointer to the magic I needed.

In the Microsoft.Dynamics.NAV.Server.exe.config file, we can turn off this ‘helper’. In the system.net section that looks roughly like so:

  <system.net>
    <settings>
      <httpListener unescapeRequestUrl="false" />
    </settings>
  </system.net>

Update that to include a setting change to the servicePointManager:

  <system.net>
    <settings>
      <httpListener unescapeRequestUrl="false" />
      <servicePointManager expect100Continue="false" />
    </settings>
  </system.net>

Restart the service tier, and voila! No more ‘helping’. Picky API, in my case, was finally satisfied.

Share this:

  • LinkedIn
  • Twitter
  • Email

Archives

  • December 2024
  • January 2023
  • December 2022
  • July 2022
  • June 2022
  • April 2022
  • November 2021
  • October 2021
  • August 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • January 2021
  • December 2020
  • November 2020
  • August 2018
  • June 2014
  • April 2014
  • September 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • March 2013
  • December 2012
  • July 2012
  • June 2012
  • December 2011
  • April 2011

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Tags

365 Business Central ActionPane api AppSource ARG ASPCA book Congress customs Extensions Facebook goodreads Govtrack hiring HR Inventory last.fm Licensing Military Minecraft moving Newsletter Nifty Ideas Password Security sick social networking The Walking Dead True Blood UserCustomization Windows 8 Zombies

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
©2025 Jeremy Vyska | WordPress Theme by Superbthemes.com