How to transfer a decimal number to a holiday web service

I want to pass the decimal number (1.23) to the WCF-REST web service.

I keep getting the "resource not found" error. I expect that I come across some IIS security feature where the URLs containing the dot are the resource. Does anyone have a suggestion on how to pass a decimal number to my web service?

Sample URL ... http: //localhost/restdataservice.svc/echo/2.2

Operating contract

[OperationContract]
[WebGet(UriTemplate = "echo/{number}")]
string Echo(string number);

And implementation

public string Foo(string number)
{
  return number;
}
+3
source share
3 answers

IIS, . , ​​, - UrlScan. UrlScan.ini, AllowDotInPath. 0, , , . 1 ( , , URL- .).

+3

, , POST.

+1

This should work fine, I cannot reproduce this problem with a similar basic setting - are you sure that the default route for your method is echoset correctly?

0
source

Source: https://habr.com/ru/post/1794210/


All Articles