Permalink
Browse files

added post_body to request

  • Loading branch information...
Kellen Presley
Kellen Presley committed Jun 27, 2010
1 parent 2fcb812 commit 1abcd2632b0cba9c960fc7756c56ca111e307106
Showing with 8 additions and 2 deletions.
  1. +1 −1 README.textile
  2. +7 −1 picard/lib/picard/request_extensions.js
View
@@ -6,7 +6,7 @@ p. If you want to check it out, install "Node":http://nodejs.org and start the s
p. Picard uses Haml thanks to creationix's haml-js project.
-p. All the tests for Picard are high level integration style tests. For right now, the test suite basically doubles as the documentation. Check the specs, or "the sample app":http://github.com/dantebronto/picard/blob/master/sample_app/app.js for examples of what is possible.
+p. Basic documentation is now available in the wiki. I recommend checking the specs, or "the sample app":http://github.com/dantebronto/picard/blob/master/sample_app/app.js for more examples of what is possible.
h3. License
@@ -148,6 +148,9 @@ var locals = {
try {
if( chunk == undefined ) { return }
var chunks = chunk.toString().replace(/\+/g, '%20').split('&')
+
+ this.post_body = ('post_body' in this) ? this.post_body + chunk : chunk;
+
for(var i in chunks){
var k_v = chunks[i].split('=')
this[k_v[0]] = decodeURIComponent(k_v[1])
@@ -169,11 +172,14 @@ var locals = {
this.captures[i] = match_data[i]
},
_log_params: function(){
+ if( this.post_body )
+ sys.puts(' post_body: ' + this.post_body.toString())
+
for( var prop in this ){
var skips = [ 'socket','connection','httpVersion','headers','url','cookie','method','statusCode','client','httpVersionMajor',
'httpVersionMinor','upgrade','handle_exception','on_screen','parsed_url','redirect','send_data','serve_static','response',
'_events','captures','route','constructor','_parseQueryString','setBodyEncoding','setEncoding','pause','resume','_addHeaderLine',
- 'emit','addListener','removeListener','removeAllListeners','listeners', 'cookies', '_method' ]
+ 'emit','addListener','removeListener','removeAllListeners','listeners', 'cookies', '_method', 'post_body' ]
if ( skips.indexOf(prop) == -1 )
sys.puts(' ' + prop + ': ' + sys.inspect(this[prop]))

0 comments on commit 1abcd26

Please sign in to comment.