Dart的HTTP请求和响应(1)
<div class="markdown_views">
<h2 id="get请求">GET请求</h2>
<p>在上代码之前,先把所需要的http包分享出来<a href="http://pan.baidu.com/s/1jGH2zgq">http://pan.baidu.com/s/1jGH2zgq</a></p>
<pre class="prettyprint"
阿里云ECS服务器部署Dart服务端程序
1.Dart服务端绑定域名为ECS的内部IP:172.31.213.9(自己的服务器内网IP)io.serve(handler, '172.31.213.9', 80).then((server) {
print('Serving at http://${server.address.host}:${server.port}');
});
2.安全组策略开启80/TCP端口。
Dart的套接字与web套接字
<div class="markdown_views">
<h2 id="套接字">套接字</h2>
<p>首先在项目中建三个dart文件,如下图</p>
<p><img title="" alt="这里写图片描述" src="http://img.blog.csdn.net/20150619144014658"></p>
<p>main.dart中的代码如下</p>