예제 #1
0
        public void ComposeGetRequest()
        {
            RequestOptionsEncrypted options = new RequestOptionsEncrypted(config, HttpMethod.Get, "/my/path");
            var reqMessage = options.ComposeRequestMessage();

            Assert.Equal(HttpMethod.Get, reqMessage.Method);
            Assert.Equal("/base/url/my/path", reqMessage.RequestUri.ToString());
        }
예제 #2
0
        public async void ComposePostRequest()
        {
            RequestOptionsEncrypted options = new RequestOptionsEncrypted(config, HttpMethod.Post, "/my/path", "['prop1': 12, 'prop2': 'abc']");
            var reqMessage = options.ComposeRequestMessage();

            Assert.Equal(HttpMethod.Post, reqMessage.Method);
            Assert.Equal("/base/url/my/path", reqMessage.RequestUri.ToString());
            string content = await reqMessage.Content.ReadAsStringAsync();

            Assert.Equal("['prop1': 12, 'prop2': 'abc']", content);
        }