INFO: HTTP GET and HTTP POST Are Disabled by Default

http://support.microsoft.com/default.aspx?scid=kb;en-us;819267

INFO: HTTP GET and HTTP POST Are Disabled by Default

Article ID:819267
Last Review:April 24, 2003
Revision:1.0

SUMMARY

This article discusses changes in the .NET Framework 1.1 that affect the HTTP GET method and the HTTP POST method on a Web server. This article also describes workarounds for this new functionality.

MORE INFORMATION

The .NET-connected Web services support HTTP GET, HTTP POST and SOAP protocols. By default, in .NET Framework 1.0, all three protocols are enabled. By default, in .NET Framework 1.1, HTTP GET and HTTP POST are both disabled. This is for security reasons.

Applications that use HTTP GET or HTTP POST to invoke a Web service fail when the Web service is upgraded to .NET Framework 1.1. These applications receive a
System.Net.WebException
error message that indicates the request format is unrecognized.

Note that the HTML-based test form uses HTTP POST, and therefore the HTML-based test form does not work in .NET Framework 1.1. This is true except on localhost as noted below.

The .NET Framework 1.1 defines a new protocol that is named HttpPostLocalhost. By default, this new protocol is enabled. This protocol permits invoking Web services that use HTTP POST requests from applications on the same computer. This is true provided the POST URL uses http://localhost, not http://hostname. This permits Web service developers to use the HTML-based test form to invoke the Web service from the same computer where the Web service resides.

When you try to access the Web service from a remote computer you do not see the Invoke button. And, you receive the following error message:

The test form is only available for requests from the local machine

Workaround

HTTP GET and HTTP POST may be enabled by editing the Web.config file for the vroot where the Web service resides. The following configuration enables both HTTP GET and HTTP POST:
<configuration>
<system.web>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
</system.web>
</configuration>
Alternatively, you can enable these protocols for all Web services on the computer by editing the <protocols> section in Machine.config. The following example enables HTTP GET, HTTP POST, and also SOAP and HTTP POST from localhost:
<protocols>
<add name="HttpSoap"/>
<add name="HttpPost"/>
<add name="HttpGet"/>
<add name="HttpPostLocalhost"/>
<!-- Documentation enables the documentation/test pages -->
<add name="Documentation"/>
</protocols>
 

REFERENCES

For more information about Web services configuration, see the <protocols> Element in the .NET Framework 1.1 documentation: http://msdn.microsoft.com/library/en-us/cpgenref/html/gngrfprotocols.asp (http://msdn.microsoft.com/library/en-us/cpgenref/html/gngrfprotocols.asp)

 
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
*** Starting uWSGI 2.0.17.1 (64bit) on [Thu May 25 21:02:53 2023] *** compiled with version: 4.8.2 20140120 (Red Hat 4.8.2-16) on 25 May 2023 09:54:48 os: Linux-3.10.0-862.3.2.el7.x86_64 #1 SMP Mon May 21 23:36:36 UTC 2018 nodename: vga-fmea-pbd machine: x86_64 clock source: unix pcre jit disabled detected number of CPU cores: 32 current working directory: /web/www/teamvision/uwsgi-2.0.17.1 detected binary path: /web/www/teamvision/uwsgi-2.0.17.1/uwsgi chdir() to /web/www/teamvision your processes number limit is 4096 your memory page size is 4096 bytes *** WARNING: you have enabled harakiri without post buffering. Slow upload could be rejected on post-unbuffered webservers *** detected max file descriptor number: 1024 VirtualHosting mode enabled. lock engine: pthread robust mutexes thunder lock: disabled (you can enable it with --thunder-lock) uwsgi socket 0 bound to TCP address 0.0.0.0:8033 fd 6 Python version: 3.5.4 (default, May 25 2023, 15:10:10) [GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] Python main interpreter initialized at 0x16ca940 python threads support enabled your server socket listen backlog is limited to 100 connections your mercy for graceful operations on workers is 10 seconds mapped 2539800 bytes (2480 KB) for 24 cores *** Operational MODE: preforking *** added /usr/local/python3.5b/python3.5/site-packages to pythonpath. Traceback (most recent call last): File "./teamvision/web_wsgi.py", line 7, in <module> from django.core.wsgi import get_wsgi_application ImportError: No module named 'django' unable to load app 0 (mountpoint='') (callable not found or import error) *** no app loaded. going in full dynamic mode *** *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 376163) spawned uWSGI worker 1 (pid: 376164, cores: 1) spawned uWSGI worker 2 (pid: 376165, cores: 1)
05-30
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值