postForm() public method

post the url encoded form to remote server
public postForm ( string pUrl, string>.Dictionary pHeaders, string[]>.Dictionary pPostParams, CompletionHandler pCompletionHandler ) : void
pUrl string
pHeaders string>.Dictionary
pPostParams string[]>.Dictionary
pCompletionHandler CompletionHandler
return void
コード例 #1
0
ファイル: HttpManager2Test.cs プロジェクト: qiniu/csharp-sdk
        public void reqPostTest()
        {
            HttpManager target = new HttpManager();
            string pUrl = "http://ip.taobao.com/service/getIpInfo.php";
            Dictionary<string, string> pHeaders = new Dictionary<string, string>();
            Dictionary<string, string[]> pPostParams = new Dictionary<string, string[]>();
            pPostParams.Add("ip", new string[] { "100.123.199.44", "100.123.199.45" });

            CompletionHandler pCompletionHandler = new CompletionHandler(delegate(ResponseInfo respInfo, string response)
            {
                Assert.AreEqual(respInfo.StatusCode, 200);
            });
            target.postForm(pUrl, pHeaders, pPostParams, pCompletionHandler);
        }