C # the following error occurs when post data: system. net. webexception: Remote Server Return Error: (417) Expectation failed solution

Source: Internet
Author: User
. Net (client) Call PHP (server) Error 417

Problem description:
Server environment:
Linux + Apache (Lighttpd) + PhP5

Client environment:
Windows XP + IIS +. net


The following error occurs during the call:
System. net. webexception: Error returned by the remote server: (417) Expectation failed. In system. net. httpwebrequest. getresponse () in org. phprpc. phprpc_client.post (string requeststring) at Org. phprpc. phprpc_client.invoke (string function, object [] ARGs, Boolean byref, byte encryptmode)

Detected error:
If the service is written on a Windows machine, the error will disappear.


After guidance from the cool "prodigy:
Write. net Program Start-up Code Or in a file such as app. config.
Just add this sentence.
Servicepointmanager. expect100continue = false;


Good results, problem solving



To sum up the reasons:
The httpwebrequest control has a transparent process. It first queries the service provider for the existence of a URL without sending post content. If the server confirms that the URL is accessible, it sends a post, early Apache thought this was an error, but IIS was able to respond correctly (prodigy) . Net (client) Call PHP (server) Error 417

Problem description:
Server environment:
Linux + Apache (Lighttpd) + PhP5

Client environment:
Windows XP + IIS +. net


The following error occurs during the call:
System. net. webexception: Error returned by the remote server: (417) Expectation failed. In system. net. httpwebrequest. getresponse () in org. phprpc. phprpc_client.post (string requeststring) at Org. phprpc. phprpc_client.invoke (string function, object [] ARGs, Boolean byref, byte encryptmode)

Detected error:
If the service is written on a Windows machine, the error will disappear.


After guidance from the cool "prodigy:
The. NET program is written in the initial code, or in a file such as the configuration file app. config.
Just add this sentence.
Servicepointmanager. expect100continue = false;


Good results, problem solving



To sum up the reasons:
The httpwebrequest control has a transparent process. It first queries the service provider for the existence of a URL without sending post content. If the server confirms that the URL is accessible, it sends a post, early Apache thought this was an error, but IIS was able to respond correctly (prodigy)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.