2012年11月15日

用Curl测试POST

摘要: POST请求 http://172.16.102.208:8089/wiapi/score?leaderboard_id=1&score=36&app_key=66 目的1:通过脚本发送post请求。 答案:curl -d "leaderboard_id=7778a8143f111272&score=19&app_key=8d49f16fe034b98b&_test_user=test01" "http://172.16.102.208:8089/wiapi/score" 目的2:通过脚本发送post请求,顺便附带 阅读全文

posted @ 2012-11-15 16:54 小浪鼓 阅读(103943) 评论(8) 推荐(2) 编辑

respond_to 和 respond_with

摘要: 转自:http://caterpillar.onlyfun.net/Gossip/Rails/RespondToWith.htmlrespond_to可以讓你根據客戶端要求的格式進行不同的格式回應,以RESTful 與 Rails中完成的應用程式首頁為例,若想要客戶端在請求http://localhost:3000/bookmarks.html、http://localhost:3000/bookmarks.xml、http://localhost:3000/bookmarks.json時,分別給HTML、XML、JSON格式回應,可以如下修改:bookmarks_controller.rbc 阅读全文

posted @ 2012-11-15 14:42 小浪鼓 阅读(4321) 评论(0) 推荐(1) 编辑

Rails Migration:更改table的行数据类型

摘要: 1 生成migration文件rails g migration change_data_type_for_fieldname2 更改文件内容class ChangeDataTypeForFieldname < ActiveRecord::Migration def change change_column :talbename, :columnname, :type endend参考文档 阅读全文

posted @ 2012-11-15 14:24 小浪鼓 阅读(984) 评论(0) 推荐(0) 编辑

导航