Documentation fix (correctly return promises in session example)

pull/4/head
Sven Slootweg 9 years ago
parent 752250a16b
commit 1fdaac9099

@ -117,9 +117,9 @@ var session = bhttp.session({ headers: {"user-agent": "MyCustomUserAgent/2.0"} }
// Our new session now automatically has a cookie jar, and also uses our preset option(s).
Promise.try(function(){
session.get("http://hypotheticalsite.com/cookietest"); // Assume that this site now sets a cookie
return session.get("http://hypotheticalsite.com/cookietest"); // Assume that this site now sets a cookie
}).then(function(response){
session.get("http://hypotheticalsite.com/other-endpoint"); // This now sends along the cookie!
return session.get("http://hypotheticalsite.com/other-endpoint"); // This now sends along the cookie!
});
```

@ -1,6 +1,6 @@
{
"name": "bhttp",
"version": "1.0.3",
"version": "1.0.4",
"description": "A sane HTTP client library for Node.js with Streams2 support.",
"main": "index.js",
"scripts": {

Loading…
Cancel
Save