using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Net.Http; using System.Text; using System.Threading.Tasks; namespace HttpClientTest { class Program { static void Main(string[] args) {
HttpClient类包含在System.Net.Http命名空间中,是向以URI标识的网络资源发送HTTP请求和接收HTTP响应的基类.在HTTP请求中使用该类可以向Web服务发送GET.POST等异步请求,并接收服务器返回的响应数据. 下面以一个应用程序为例,介绍如何使用HttpClient类向Web服务发送GET请求并接收响应数据.该应用使用HttpClient类从网络获得XML格式的数据并在应用界面上显示. 在Visual Studio 2012中新建一个Windows应用商店的空白应用
原文链接:Demystifying HttpClient APIs in the Universal Windows Platform 正打算翻译这篇文章时,发现园子里已经有朋友翻译过了,既然已经开始了,就再概要的翻译一遍吧,就不逐字逐句了 :) .这段时间没有春节前那么忙了,正好整理一下技术文档. 译文: 作为一个 Universal Windows Platform (UWP) app 开发者,如果想通过 HTTP 协议与 web服务器端进行交互,你有很多的 API 可以选择.两个最常用.