Permalink
Browse files

post_info: send Content-Length header

  • Loading branch information...
1 parent 22f7c16 commit b744202fa883701db446e8e1b4f1a23eb24a36ee @andrewschaaf andrewschaaf committed Feb 2, 2014
Showing with 6 additions and 2 deletions.
  1. +6 −2 node-http-client.coffee
@@ -11,8 +11,12 @@ get_info = (expected_code, url, c) ->
post_info = (expected_code, url, info, c) ->
- req_body = JSON.stringify info, null, 2
- headers = {'Content-Type': 'application/json'}
+ json = JSON.stringify info, null, 2
+ req_body = new Buffer json, 'utf8'
+ headers = {
+ 'Content-Type': 'application/json'
+ 'Content-Length': req_body.length
+ }
_request 'POST', expected_code, url, req_body, headers, _resParsing(c)

0 comments on commit b744202

Please sign in to comment.