Ejemplo n.º 1
0
 public HttpUrl(HttpUrlDescriptor descriptor, string baseUrl)
 {
     this.descriptor = descriptor;
     BaseUrl = baseUrl;
     Path = new HttpUrlPath();
     Query = new HttpUrlQuery();
 }
Ejemplo n.º 2
0
 public HttpUrl(HttpUrlDescriptor descriptor, string baseUrl)
 {
     Descriptor = descriptor;
     BaseUrl    = baseUrl;
     Path       = new HttpUrlPath();
     Query      = new HttpUrlQuery();
 }
Ejemplo n.º 3
0
 public void VariableQueryTwoValues()
 {
     var variable = new VariableHttpPathPart("variable");
     var url = new HttpUrlDescriptor(new KeyValuePair<string, HttpUrlPart>("key", variable)).CreateUrl("http://localhost");
     url.Query["variable"] = new[] { "value1", "value2" };
     Assert.AreEqual("http://localhost?key=value1&key=value2", url.ToString());
 }
Ejemplo n.º 4
0
 public void Variable()
 {
     var variable = new VariableHttpPathPart("key");
     var url = new HttpUrlDescriptor(variable).CreateUrl("http://localhost");
     url.Path["key"] = "foo";
     Assert.AreEqual("http://localhost/foo", url.ToString());
 }
Ejemplo n.º 5
0
 public void Mix()
 {
     var variable = new VariableHttpPathPart("key");
     var url = new HttpUrlDescriptor("path/", variable, "/api").CreateUrl("http://localhost");
     url.Path["key"] = "to";
     Assert.AreEqual("http://localhost/path/to/api", url.ToString());
 }
Ejemplo n.º 6
0
 public void FullUrl()
 {
     var variable1 = new VariableHttpPathPart("key1");
     var variable2 = new VariableHttpPathPart("variable2");
     var url = new HttpUrlDescriptor(new[] { variable1 }, new[] { new KeyValuePair<string, HttpUrlPart>("key2", variable2) }).CreateUrl("http://localhost");
     url.Path["key1"] = "value1";
     url.Query["variable2"] = new[] { "value2" };
     Assert.AreEqual("http://localhost/value1?key2=value2", url.ToString());
 }
Ejemplo n.º 7
0
 public HttpApiEndpoint(
     HttpUrlDescriptor url,
     HttpMethod method,
     Dictionary<string, IHttpArgumentHandler> argumentHandlers,
     IHttpResponseHandler responseHandler,
     IEnumerable<HttpHeader> headers)
 {
     Url = url;
     Method = method;
     ArgumentHandlers = argumentHandlers;
     ResponseHandler = responseHandler;
     Headers = headers.ToList();
 }
Ejemplo n.º 8
0
 public void LiteralQuery()
 {
     var url = new HttpUrlDescriptor(new KeyValuePair<string, HttpUrlPart>("key", "value")).CreateUrl("http://localhost");
     Assert.AreEqual("http://localhost?key=value", url.ToString());
 }
Ejemplo n.º 9
0
 public void Literal()
 {
     var path = new HttpUrlDescriptor("foo").CreateUrl("http://localhost");
     Assert.AreEqual("http://localhost/foo", path.ToString());
 }