Paip. Solution to the remote server return error (417) Expectation failed

Source: Internet
Author: User

Paip. Solution to the remote server return error (417) Expectation failed

Author attilax, email: 1466519819@qq.com

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, while IIS

But can respond correctly

Remarks
When this attribute is set to true, client requests using the POST method should receive a 100-continue response from the server to indicate that the client should send the data to be published. This mechanism enables the client to report messages based on requests on the server

To avoid sending large amounts of data on the network

For example, assume that the system. net. sockets. servicepointmanager. expect100continue attribute is false. When a request is sent to the server, it includes data. If the server requires authentication after reading the Request Header

The client must use the correct authentication header to resend the data.

If this attribute is true, the request header is sent to the server. If the server does not reject the request, it will send 100-

Continue response, indicating that data can be transmitted. As in the previous example, if the server requires authentication, it will send a 401 response, and the client does not necessarily transmit data.

Solution:
-------------

Write. netProgramStart-upCodeOr in a file such as app. config.
Just add this sentence.

Servicepointmanager. expect100continue = false;

Refer:
-----------
C # solution to system. net. webexception remote server error (417) Expectation failed when simulating post data submission
Expect100continue_ _sina blog .htm

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.