예제 #1
0
 private static Container CreateContainerVersioningByHeader()
 {
     Container c = new Container(new Uri(BaseAddress + "/versionbyheader"));
     c.SendingRequest += (sender, e) =>
     {
         e.RequestHeaders.Add("v", "2");
     };
     return c;
 }
예제 #2
0
        private static Container CreateContainerVersioningByQueryString()
        {
            Container c = new Container(new Uri(BaseAddress + "/versionbyquery"));
            c.BuildingRequest += (sender, e) =>
            {
                UriBuilder builder = new UriBuilder(e.RequestUri);
                if (string.IsNullOrEmpty(builder.Query))
                {
                    builder.Query = "v=2";
                }
                else
                {
                    builder.Query += "&v=2";
                }

                e.RequestUri = builder.Uri;
            };
            return c;
        }
예제 #3
0
 private static Container CreateContainerVersioningByRoute()
 {
     Container c = new Container(new Uri(BaseAddress + "/versionbyroute/v2"));
     return c;
 }