本文介绍了使用HttpClient-windows phone 8.1通过POST方法传递参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨伙计们:) 

i希望有人可以帮助我 

当我使用此代码通过post方法传递参数时使用Windows Phone 8中的WebClient 

hi guys :) 
i wish someone can help me 
when i used this code to Pass parameters with post method Using WebClient in Windows phone 8 

  public void ActivatePackage()
        {
          
            LoadingProgressIndecator();
            string URI = "http://www.example.com";
            string myParameters = "hash_code=454&"+"user_code=45";
            App.wc = new WebClient();
            App.wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
            App.wc.UploadStringAsync(new Uri(URI), "put", myParameters);
            App.wc.UploadStringCompleted += new UploadStringCompletedEventHandler(webClient_Upload_ActivatePackage);
        }
        void webClient_Upload_ActivatePackage(object sender, UploadStringCompletedEventArgs e)
        {
//Some code here
         }


但是那里在Windows Phone 8.1中没有WebClient :(它变成了HttpRequest indstead。

那么我怎样才能使用HttpRequest制作相同的例子"代码块"??????? />


提前致谢^^

but there is no WebClient in windows phone 8.1 :( it becomes HttpRequest indstead.
So how can i make the same example "block of code" that i inserted using HttpRequest ???????

Thanks in advance ^^

推荐答案

对于某些示例,请查看:  http://monkeyweekend.wordpress.com/2014/10/23/how-to-send-text-json-or-files-using-httpclient -postasync /

For some examples, look at: http://monkeyweekend.wordpress.com/2014/10/23/how-to-send-text-json-or-files-using-httpclient-postasync/


这篇关于使用HttpClient-windows phone 8.1通过POST方法传递参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 01:08