-1

My web performance test is sending an Expect: 100 continue headers on POST requests. For some pages the web site being tested is returning a 417 Expectation Failed with the message The expectation given in the Expect request-header field could not be met by this server.

How can I suppress this one header field from being sent by my web test?

(Using Visual Studio 2015.)

AdrianHHH
  • 13,492
  • 16
  • 50
  • 87

1 Answers1

0

Can remove all Expect headers by using the following plugin. The code was based on this Microsoft page.

public class CancelExpect100Continue : WebTestPlugin
{
    public override void PreWebTest(object sender, PreWebTestEventArgs e)
    {
        System.Net.ServicePointManager.Expect100Continue = false;
    }
}

Details of the Expect100Continue field and when Expect headers are added to requests can be found in this MSDN page.

AdrianHHH
  • 13,492
  • 16
  • 50
  • 87