我有一个用c#编写的WCF Web服务。我有一个像这样定义的Put方法:
[OperationContract]
[WebInvoke(Method = "PUT", UriTemplate = "MobileDevice?name={name}&make={make}&model={model}&serial={serial}&software={software}")]
MobileDeviceView RegisterMobileDevice(string name, string make, string model, string serial, string software);
在我的实现中,我是否需要为每个参数调用HttpUtility.UrlDecode(name);
?
public MobileDeviceView RegisterMobileDevice(string name, string make, string model, string serial, string software)
{
string safeName = HttpUtility.UrlDecode(name);
string safeMake = HttpUtility.UrlDecode(make);
string safeModel = HttpUtility.UrlDecode(model);
string safeSerial = HttpUtility.UrlDecode(serial);
string safeSoftware = HttpUtility.UrlDecode(software);
...
}