开发者

How to pass parameters to rest web service without using the (?) Symbol?

开发者 https://www.devze.com 2023-01-22 04:30 出处:网络
I have developed a rest web service by using the following link http://www.c-sharpcorner.com/UploadFile/dhananjaycoder/simplerestservice11172009221218PM/simplerestservice.aspx

I have developed a rest web service by using the following link

http://www.c-sharpcorner.com/UploadFile/dhananjaycoder/simplerestservice11172009221218PM/simplerestservice.aspx

Now, I am passing parameters to this rest web service by using URL. I am passing parameters as follows

http://localhost:50362/PMTSRest/Service.svc/GetProj开发者_开发知识库ects?ProjectID=1

Now I want to know is there any way to remove the question mark in the URL & instead of it use any other symbol or how to pass parameters to the rest web service without using the (?) symbol ? Can you please provide me any code or link through which I can resolve the above issue?


I think you are asking how to put the parameters in a path segment. e.g.

[ServiceContract]
public interface ISearch
{
    [OperationContract]
    [WebGet(UriTemplate = "/Search/{name}", BodyStyle = WebMessageBodyStyle.Bare)]
    string  GetGreeting(string name);
}

Is this what you are looking for?


Maybe use HTTP POST instead HTTP GET to hide these parameters?

0

精彩评论

暂无评论...
验证码 换一张
取 消