注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

阿弥陀佛

街树飘影未见尘 潭月潜水了无声 般若观照心空静...

 
 
 

日志

 
 
关于我

一直从事气象预报、服务建模实践应用。 注重气象物理场、实况场、地理信息、本体知识库、分布式气象内容管理系统建立。 对Barnes客观分析, 小波,计算神经网络、信任传播、贝叶斯推理、专家系统、网络本体语言有一定体会。 一直使用Java、Delphi、Prolog、SQL编程。

网易考拉推荐

install httpie 测试akka代码  

2014-09-08 21:42:27|  分类: Akka |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
install httpie
1. install python3, add PATH  C:\Python34; C:\Python34\Scripts
2. 以管理员身份运行cmd
curl http://python-distribute.org/distribute_setup.py | python
pip install -U https://github.com/jkbr/httpie/tarball/master
3. 运行cmd
http
这样就可以控制台方式执行http的命令了
========================================================
测试:
cd F:\akka-in-action\chapter2
F:\
akka-in-action\chapter2>sbt run
另外开一个cmd
C:\>http PUT localhost:5000/events event=RHCP nrOfTickets:=10
HTTP/1.1 200 OK
Content-Length: 2
Content-Type: text/plain; charset=UTF-8
Date: Tue, 09 Sep 2014 05:56:32 GMT
Server: GoTicks.com REST API

OK
========================================================
C:\>
http PUT localhost:5000/events event=DjMadlib nrOfTickets:=15
HTTP/1.1 200 OK
Content-Length: 2
Content-Type: text/plain; charset=UTF-8
Date: Tue, 09 Sep 2014 06:03:44 GMT
Server: GoTicks.com REST API

OK
========================================================
C:\>http GET localhost:5000/events
HTTP/1.1 200 OK
Content-Length: 92
Content-Type: application/json; charset=UTF-8
Date: Tue, 09 Sep 2014 06:05:01 GMT
Server: GoTicks.com REST API

[
    {
        "event": "DjMadlib",
        "nrOfTickets": 15
    },
    {
        "event": "RHCP",
        "nrOfTickets": 10
    }
]
===========================================================
C:\>http GET localhost:5000/ticket/RHCP
HTTP/1.1 200 OK
Content-Length: 32
Content-Type: application/json; charset=UTF-8
Date: Tue, 09 Sep 2014 06:09:49 GMT
Server: GoTicks.com REST API

{
    "event": "RHCP",
    "nr": 1
}
==========================================================
不停的取票RHCP....
C:\>http GET localhost:5000/events
HTTP/1.1 200 OK
Content-Length: 91
Content-Type: application/json; charset=UTF-8
Date: Tue, 09 Sep 2014 06:11:16 GMT
Server: GoTicks.com REST API

[
    {
        "event": "DjMadlib",
        "nrOfTickets": 15
    },
    {
        "event": "RHCP",
        "nrOfTickets": 9
    }
]
==========================================================
C:\>http GET localhost:5000/ticket/RHCP
HTTP/1.1 200 OK
Content-Length: 33
Content-Type: application/json; charset=UTF-8
Date: Tue, 09 Sep 2014 06:13:15 GMT
Server: GoTicks.com REST API

{
    "event": "RHCP",
    "nr": 10
}


C:\>http GET localhost:5000/ticket/RHCP
HTTP/1.1 404 Not Found
Content-Length: 83
Content-Type: text/plain; charset=UTF-8
Date: Tue, 09 Sep 2014 06:13:17 GMT
Server: GoTicks.com REST API

The requested resource could not be found but may be available again in the futu
re.
====================================================================
That concludes all the API calls in the REST interface. Clearly, at this point, the
application supports the basic Event CRUD cycle from creation of the actual
Event, through the sale of all the tickets until they are sold out.
  评论这张
 
阅读(495)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017