none
Restful Service URI template RRS feed

Answers

  • Hi,

    Please try to check this following code, hope it can help you:
    In the IService1:

     public interface IService1
        {
    
            [OperationContract]
            [WebGet(UriTemplate="/fied1={id}/field={name}")]
            string GetData(string id,string name);
        }


    In the Service1:

    public class Service1 : IService1
        {
            public string GetData(string id,string name)
            {
                
                return string.Format("You entered:{0}{1}",id,name);
            }
    }


    Then in the brower:

    This article will give you more details on the variations of supplying parameters to a REST service, please try to check it:
    http://msdn.microsoft.com/en-us/library/bb675245.aspx .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, March 3, 2014 2:51 AM
    Moderator