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 6af6046 commit 160dc6c
Showing 1 changed file with 46 additions and 2 deletions.
48 changes: 46 additions & 2 deletions README.md
Expand Up @@ -35,9 +35,8 @@ req.end('World');

GET request example :
<pre><code>
var get = client.request(
var req = client.get(
{
method: 'GET',
path : '',
url : '/',
port: 3000,
Expand All @@ -52,4 +51,49 @@ var get = client.request(

});

req.on('error', function(err){
logger.error(err);
});

</code></pre>

PING example :

<pre><code>
client.ping({
port: 3000,
host: 'localhost'
},
function(id){
// success callback
}
);
</code></pre>

PUSH handler example :

<code><pre>
var req = client.request(
{
method: 'GET',
path : '',
url : '/',
port: 4000,
host: 'localhost',
pushcb : function(opt, originreq)
{
// application handling
// The client accepts the pushed data or not
return {
error : null,
success : function(res){
//...
}
};
}
},
function(response){
//....
});

</code></pre>

0 comments on commit 160dc6c

Please sign in to comment.