Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nasss committed Apr 22, 2013
1 parent 6da40b1 commit 6af6046
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Expand Up @@ -6,6 +6,7 @@ With this module, you can create SPDY clients in node.js. You can send requests
Usage
===========

POST request example :
<pre><code>
var client = require('client');

Expand All @@ -29,6 +30,26 @@ var req = client.post(
);
req.write('Hello');
req.end('World');
</code></pre>


GET request example :
<pre><code>
var get = client.request(
{
method: 'GET',
path : '',
url : '/',
port: 3000,
host: 'localhost'
},
function(response){
logger.info("--- GET RESPONSE --");
response.once('data', function (chunk) {
var data = String.fromCharCode.apply(null, new Uint16Array(chunk));
logger.info(data);
});

});

</code></pre>

0 comments on commit 6af6046

Please sign in to comment.