HTTP GET and HTTP POST is disabled by default

xiaoxiao2021-03-06  61

HTTP GET and HTTP POST is disabled by default

Suitable

Summary This article discusses .NET Framework 1.1 affects the web server

HTTP GET method and

Changes in the HTTP POST method. This article also provides solutions to this new feature.

MORE INFORMATION Connects .NET Web Services supports HTTP GET, HTTP POST, and SOAP protocols. In .NET Framework 1.0, all three protocols are enabled by default. But in .NET Framework 1.1, the HTTP GET and HTTP POST are also disabled by default. This is for security considerations.

When the web service is upgraded to .NET Framework 1.1, the application will fail when the application uses the HTTP GET or HTTP POST to call the web service. These applications receive one of the following error messages

System.net.webException

It is pointed out that the request format cannot be identified.

Note that the HTML-based test form uses HTTP POST, so the HTML-based test form is not applicable in .NET Framework 1.1. This is true unless the form is on the local host mentioned below.

.NET FRAMEWORK 1.1 defines a named

New protocol of HttppostLocalhost. By default, this new protocol is enabled. This protocol allows the service to call the service from the application that is located on the same computer from the web service requested using the HTTP POST. The prerequisites allowed: POST URL

Http: // localhost, not

Http://hostname. This allows web service developers to call the web service from the same computer from the web service based on HTML-based test forms.

When you try to access the web service from a remote computer, the Call button will not be displayed. Also, you receive the following error message:

Test Form Is Only Available for Requests from The Local Machine

The alternative method can enable HTTP GET and HTTP POST by editing the VROOT's web.config file where Web service is located. The following configuration is also enabled HTTP GET and HTTP POST:

or, these protocols can be enabled for all web services on the computer by editing in Machine.config. The following example enables HTTP GET, HTTP POST, and SOAP, and HTTP POST is enabled from the local host:

Refer to more information about Web service configuration, see the .NET Framework 1.1 documentation

element description:

http://msdn.microsoft.com/library/en-us/cpgenref/html/gngrfprotocols.asp

The information in this article applies to:

Microsoft .NET Framework 1.1

转载请注明原文地址:https://www.9cbs.com/read-112205.html

New Post(0)