在ServiceOperation上允许HTTP POST或HTTP GET [英] Allow HTTP POST or HTTP GET on a ServiceOperation

查看:97
本文介绍了在ServiceOperation上允许HTTP POST或HTTP GET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有我的服务操作,我有许多不同的潜在应用程序/应用程序开发人员,他们将对此服务操作进行编码。

So I have my service operation and I have many different potential applications/application developers who will be coding against this service operation.

我添加了

[WebInvoke]到我的ServiceOperation

[WebInvoke] to my ServiceOperation

HTTP Post工作正常

HTTP Post works fine

 

是否无法允许HTTP Post和HTTP获取相同的操作?

is there no way to allow both HTTP Post and HTTP Get on the same operation?

例如:   

For example:    

[ WebInvoke(Method =" *")]

[WebInvoke(Method="*")]

 

或者我是否仅限于选择单个HTTP方法?

Or am I limited to choosing a single HTTP method ?

 

谢谢

 

 

 

 

推荐答案

目前我们将WebGet限制为GET,将WebInvoke限制为POST,每个方法只能有一个(如果指定了两个,我们选择WebGet)。另一方面,没有什么可以阻止您公开内部共享实现的两个服务操作。

Currently we limit WebGet to GET and WebInvoke to POST and each method can only have one of these (we pick WebGet if both are specified). On the other hand nothing prevents you from exposing two service operations which internally share the implementation.

谢谢,


这篇关于在ServiceOperation上允许HTTP POST或HTTP GET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆