Windows Phone 15, HttpWebRequest

Source: Internet
Author: User

Objects in the Windows runtime that support access to network resources: HttpWebRequest objects

Send Get/post request, Httphelper package, timeout control.

HttpClient Object

Send Get/post request, request Progress Monitor.

Two common request types: GET Requests

The main request for data from the server

Can pass Limited (1024 bytes) of data

POST Request

The main is to send data to the server, there is no limit to the size of data transfer.

You can also receive server-side data, but most of the request results are identified.

HttpWebRequest
1     < Grid > 2         < WebView 3             x:name = "WebView" /> 4     </ Grid >
1         protected Async Override voidonnavigatedto (NavigationEventArgs e)2         {3             //Create Request Object4HttpWebRequest request = Webrequest.createhttp ("http://www.baidu.com");5             //Set Request Parameters6Request. Accept ="*/*";7Request. Method ="GET";8Request. headers["Cookies"] ="Key1=value;key2=val";//Password Storage area9             //send a request to get the service-side responseTen             varResponse =awaitrequest. Getresponseasync (); One             using(varstream =Response. GetResponseStream ()) A             { -                 using(varReader =NewStreamReader (stream)) -                 { the                     varresult =awaitReader. Readtoendasync (); - webview.navigatetostring (result); -                 } -             } +}

Windows Phone 15, HttpWebRequest

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.