Issue with Web request: Expect: 100-continue in header

Hi all,
I’m trying to use a web request but receive an error message.
It seems that easymorph adds by default in header the “Expect:100-continue” value.
Could you please let me know if this is true and how can I avoid this?

thank you so much
Claudio

Here the error message I received:

HTTP/1.1 417 Expectation Failed
Strict-Transport-Security: max-age=16070400
Connection: close
Date: Tue, 08 Jun 2021 19:11:01 GMT
Server: Apache
Content-Length: 364
Content-Type: text/html; charset=iso-8859-1

417 Expectation Failed

Expectation Failed

The expectation given in the Expect request-header field could not be met by this server. The client sent

    Expect: 100-continue

Only the 100-continue expectation is supported.

I tried to add an expect value in header:

So , for sure EM automatically add “100-continue”.
How can I change this?
Please help
Claudio

Sorry guys,
could anyone in EM answer me? (@dgudkov)

thank you so much
claudio

Hi Claudio,

Sorry for the delay. We’ve identified the problem and still thinking about how to deal with it. I’ll keep you posted.

Thank you Dmitry!

The Expect header is part of the HTTP protocol for requests with the body such as POST or PUT. It’s a low-level detail of the protocol implementation. A webserver must accept it and process it correctly.

However, it appears that your proxy (Apache with mod_proxy?) is either outdated or incorrectly configured. There was a bug in mod_proxy that rejected the Expect header, so maybe your proxy hasn’t been updated.

I would be reluctant to add a new setting to EasyMorph to deal with incorrectly configured webservers or proxies. Therefore, I suggest trying the following:

Try sending web requests via another proxy (if the proxy is in your network), if possible.

Contact the owners of the proxy (webserver) and ask them to resolve the problem on their end by updating their software or configuring it properly.

As the last resort, add the following section to your Morph.exe.config file:

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

If you run the project in EasyMorph Server, add that section to C:\Program Files\EasyMorph Server\app.config.

Thank you Dmitry,
I tried the last one, because the first two were more complicated (it is not my proxy but of my client), and it works!

Thank you so much for your help and sorry if I bothered you with this request (but you solved a big problem for me)

You’re welcome! :slight_smile: