I need to define a WCF GET method which can retrieve all the query parameters as a single string. Example:
https://xxx.xxx.xxx.xxx/token?client_id=abc_def&client_name=&type=auth&code=xyz
I want to grab the string "client_id=abc_def&client_name=&type=auth&code=xyz".
How do I define the URI template for the method? I tried the following, but it doesn't work as I will get 400 Bad Request. Replacing the /" with "?" makes no difference.
[WebGet(UriTemplate = "token/{Params}")]
[OperationContract]
Stream GetToken(string Params);
The method will call an external service and just forward whatever query parameters that it receives. I don't want individually retrieve each parameters, as it is possible that the parameters may increase.
Another URL would be like this:
https://xxx.xxx.xxx.xxx/person/123456?client_id=abc_def&client_name=&type=auth&code=xyz
In this case, I would like to grab the two strings "123456" and "client_id=abc_def&client_name=&type=auth&code=xyz".
How do I define the URI template for the method?