webservice post 和get方法

在C#中,新建一个webservice,默认是post类型的。

所谓的post就是指方法的参数不是靠URl传入进去的,而是靠的是直接输入值。

而Get方式的话,是可以直接访问webservice的方法,然后参数,在source可以通过

“this.Context.Request.QueryString["FeedUrl"];”获得。

URL:

http://localhost:9901/Service.asmx/ChangeArticleCodeLength?FeedUrl=http%3A%2F%2Fmoney.jp.msn.com%2Ftopics_db_rss%2Fbizmakoto_economy.aspx

(访问:ChangeArticleCodeLength方法)

在WEBConfig里面配置如下:{即可以是Post,也可以是Get类型的}

    <system.web>

<webServices>
<protocols>
<add name="HttpPost"/>
<add name="HttpGet"/>
</protocols>
</webServices>

    </system.web>

寻找21世纪的伯牙
原文地址:https://www.cnblogs.com/2814/p/2872809.html