You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**NOTE:**_Since version 0.8.0 node does not contain node-waf anymore. The node-zlib package which node-rest-client make use of, depends on node-waf.Fortunately since version 0.8.0 zlib is a core dependency of node, so since version 1.0 of node-rest-client the explicit dependency to "zlib" has been removed from package.json. therefore if you are using a version below 0.8.0 of node please use a versión below 1.0.0 of "node-rest-client". _
4
8
@@ -7,12 +11,14 @@ Allows connecting to any API REST and get results as js Object. The client has t
7
11
- Transparent HTTP/HTTPS connection to remote API sites.
8
12
- Allows simple HTTP basic authentication.
9
13
- Allows most common HTTP operations: GET, POST, PUT, DELETE, PATCH.
14
+
- Allows creation of custom HTTP Methods (PURGE, etc.)
10
15
- Direct or through proxy connection to remote API sites.
11
16
- Register remote API operations as client own methods, simplifying reuse.
12
17
- Automatic parsing of XML and JSON response documents as js objects.
13
18
- Dynamic path and query parameters and request headers.
14
19
- Improved Error handling mechanism (client or specific request)
15
20
- Added support for compressed responses: gzip and deflate
21
+
- Added support for follow redirects thanks to great [follow-redirects](https://www.npmjs.com/package/follow-redirects) package
To send data to remote site using POST or PUT methods, just add a data attribute to args object:
@@ -284,7 +288,23 @@ req.on('error', function (err) {
284
288
console.log('request error', err);
285
289
});
286
290
```
291
+
### Follows Redirect
292
+
Node REST client follows redirects by default to a maximum of 21 redirects, but it's also possible to change follows redirect default config in each request done by the client
293
+
```javascript
294
+
var client =newClient();
287
295
296
+
// request and response additional configuration
297
+
var args = {
298
+
requestConfig: {
299
+
followRedirects:true,//whether redirects should be followed(default,true)
300
+
maxRedirects:10//set max redirects allowed (default:21)
0 commit comments