set debug output
http = Net::HTTP.new("www.something.com", 80)
http.set_debug_output($stdout)
这样就可以在post的时候显示传输的内容,便于调试。
使用nc监视http请求数据
浏览器请求数据可以通过firebug等工具查看,但是有时候需要自己的程序去请求其他应用,这样调试起来很不方便。
通过netcat可以监听一个端口,并且随时回显请求的数据的最原始状态。
终端1:
nc -v -l localhost 12345
返回:
Connection from 0.0.0.0 port 12345 [tcp*
Content-Length: 5
Content-Type: application/x-www-form-urlencoded
{a:1}
终端2:
curl -XPUT http:
net/http set_form_data
Ruby自带的net/http库,的set_form_data方法在传输之前会进行encode_www_form编码,而普通的post方法是不会的:
def set_form_data(params, sep = '&')
query = URI.encode_www_form(params)
query.gsub!(/&/, sep) if sep != '&'
self.body = query
self.content_type = 'application/x-www-form-urlencoded'
end
http://rubylution.herokuapp.com/topics/20
分享到:
相关推荐
android入门学习的教程,主要讲调试debug相关的内容,非常的好,适合新手看看
推荐项目kotlin_tips,用Kotlin去提高生产力:汇总Kotlin相对于Java的优势,以及怎么用Kotlin去简洁、务实、高效、安全开发的Tips 推荐项目easy_mock_api,给客户端同学的模拟json接口的小工具 推荐项目CompatWebView...
推荐:Kotlin的实践项目debug_view_kotlin,用Kotlin实现的Android浮层调试控制台,实时的显示内存、FPS、App启动时间、Activity启动时间、文字Log 推荐:数据预加载项目and-load-aot,通过提前加载数据来提高页面...
synopsys TMAX: Tips For Simulation Debug, ATPG Pattern Validation
<script src="http://discuz.gtimg.cn/cloud/scripts/discuz_tips.js?v=1" type="text/javascript" charset="UTF-8"></script><script type="text/javascript">document.getElementById("debuginfo").innerHTML = ...
[endif]--><style data-for="debug">#debug{display:none!important}</style><style index="index">#u1 a:link,#u1 a:visited{color:#666;text-decoration:none}#u1 a:hover,#u1 a:active{text-decoration:underline...
要訣和技巧(Tips and Tricks) 266 <br/>7.1編輯程式檔(Editing Source) 266 <br/>7.2搜尋(Searching) 271 <br/>7.3程式碼導覽和讀取(Code navigation and reading) 273 <br/>7.4 Java視圖(Java views) 277 <br/>7.5...
* Source code navigation and information tips * Source code find usages * Source code refactoring and revert * Integrated [gocode](https://github.com/visualfc/gocode) clone of [nsf/gocode]...
* 讀者來函 / 1 * 第㆓版序 / 5 第㆒版序/ 7 目錄/ 13 第0章 你㆒定要知道(導讀) / 27 這本書適合誰/ 27 你需要什麼技術基礎/ 29 你需要什麼軟硬體環境/ 29 讓我們使用同㆒種語言/ 30 本書符號習慣/ 34 ...
Tips on asking questions that will get good answers 370 Opening a new ticket to report a problem 372 Summary 374 Chapter 11: When it's Time to Go Live: Moving to Production 375 Developing an ...
APU-12, SPU-100 & debug fundamentals Basics of Pattern based testing pattern based testing of a DUT Groupset accumulator Optimizing a test Introduction to Per Pin digital introduction of digital...
This power tip provides an explanation as well as some tips to get the most out of temp files. Backup and Restore Settings One of the staples of UltraEdit (and UEStudio) is its highly configurable ...
This well-paced and informative guide offers numerous excellent tips, including how to design device drivers that fit your needs, and a good deal of material on how to test and debug driver code. ...
3.7 Tips for Reducing Complexity....................................................................................26 Chapter 4. Perl Pitfalls..........................................
Learn programming tips and tools to help you perfect and debug your applications Table of Contents Chapter 1. Overview of Drupal Chapter 2. Drupal Programming Principles Chapter 3. Common Drupal ...
* Debug and validate your theme using W3C's XHTML and CSS validation tools * Customize and tweak your theme's layout * Set up dynamic drop-down menus, AJAX/dynamic and interactive forms * Download and...
Chapter 3:Using Angular Augury to Debug Your Code Chapter 4:Top Angular Plugins for Sublime Text Chapter 5:Boosting Your Workflow with Angular 5 Snippets and VS Code Chapter 6:Top 12 Productivity Tips...
profile and debug your applications; and manage media assets. Designed for Easy Learning Key Skills & Concepts--Chapter-opening lists of specific skills covered in the chapter Ask the Experts--Q&...
Develop, debug, test, and troubleshoot Java EE 7 applications rapidly with Eclipse About This Book Go beyond simply learning Java EE APIs and explore the complete workflow of developing enterprise ...
And you'll gain practical insights and tips for how to architect, design, optimize, and debug your apps. ☆ 出版信息:☆ [作者信息] Jeffrey Richter , Maarten van de Bospoort [出版机构] Microsoft ...