Ejemplo n.º 1
0
 private static Container CreateContainerVersioningByHeader()
 {
     Container c = new Container(new Uri(BaseAddress + "/versionbyheader"));
     c.SendingRequest2 += (sender, e) =>
     {
         e.RequestMessage.SetHeader("v", "1");
     };
     return c;
 }
Ejemplo n.º 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=1";
                }
                else
                {
                    builder.Query += "&v=1";
                }

                e.RequestUri = builder.Uri;
            };
            return c;
        }
Ejemplo n.º 3
0
 private static Container CreateContainerVersioningByRoute()
 {
     Container c = new Container(new Uri(BaseAddress + "/versionbyroute/v1"));
     return c;
 }