コード例 #1
0
        public void AppendQueryParam()
        {
            var url = new UrlBuilder("http://www.shoutem.com/app");

            url.AppendQueryParam("nid", 123);

            var param = url.GetQueryParam("nid");

            Assert.AreEqual("123", param.ToString());
        }
コード例 #2
0
        public void TestToString()
        {
            var url = new UrlBuilder("http://www.shoutem.local/app");

            url.SetHost("www.shoutem.com");
            url.SetScheme(Uri.UriSchemeHttps);
            url.AddPathSegment("test");
            url.SetQueryParam("nid", 123);
            url.AppendQueryParam("nid", 321);

            Assert.AreEqual("https://www.shoutem.com/app/test?nid=123&nid=321", url.ToString());
        }
コード例 #3
0
        public async Task <bool> DeleteUser_Async(string requestURI, int Application_User_ID)//User user, StringContent content)
        {
            UrlBuilder urlb = new UrlBuilder(requestURI);

            urlb.AppendQueryParam("Application_User_ID", Application_User_ID.ToString());
            using (var client = new HttpClient())
            {
                var response = await client.DeleteAsync(urlb.ToString());

                return(response.IsSuccessStatusCode);
            }
        }
コード例 #4
0
        public void AppendExistingQueryParam()
        {
            var url = new UrlBuilder("http://www.shoutem.com/app");

            url.SetQueryParam("role", "moderator");
            url.AppendQueryParam("role", "admin");

            var paramList = url.GetQueryParam("role") as IList <object>;
            var param1    = paramList[0];
            var param2    = paramList[1];

            Assert.AreEqual("moderator", param1.ToString());
            Assert.AreEqual("admin", param2.ToString());
        }