Browse Source

Documentation fix (correctly return promises in session example)

pull/4/head
Sven Slootweg 7 years ago
parent
commit
1fdaac9099
  1. 4
      README.md
  2. 2
      package.json

4
README.md

@ -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!
});
```

2
package.json

@ -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