Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Almost final 0.3.0; fixing readme and minor stuff

  • Loading branch information...
commit 996decf8eaba88dca1a3c20f70ccd953d6753a2d 1 parent f661845
Zohaib Sibte Hassan authored
16 README.md
View
@@ -31,7 +31,7 @@ Basic method to make a get request object, example:
req.send(); //Sends a simple get Request
-*URL must be properly formated i.e. must start with http:// (Currently only supports http, https coming soon)*
+* URL must be properly formated i.e. must start with http:// or https:// (https wont work for older versions of node works perfect with 0.4.0+)*
### Reston.post(url)
@@ -156,6 +156,20 @@ DEL request with querystring+data as well:
data.b = 5;
req.send(data); // Makes a delete request Sends a=1, b=5, c=3 (look how it overrides the data for b)
+### Utilties
+
+Yep they are the cherry on top
+
+ * Reston.accumulate(restonObject, encoding) accumulates response for you
+
+ var req = Reston.get('http://localhost/data.php?a=1&b=2&c=3');
+ var acc = Reston.accumulate(req, 'utf-8');
+ req.on('end', function(){
+ console.log(acc.data); // Body or response
+ console.log(acc.headers); // Headers of response
+ });
+
+
### Events
Following events are triggered on Reston object:
6 lib/Core.js
View
@@ -43,8 +43,4 @@ var core = {
'node_ver': node_ver
};
-if( module ){
- module.exports = core;
-}else if(exports){
- exports = core;
-}
+module.exports = core;
6 lib/FileStream.js
View
@@ -79,8 +79,4 @@ core.mixin(FileStream.prototype, {
});
-if(module){
- module.exports = FileStream;
-}else{
- exports = FileStream;
-}
+module.exports = FileStream;
2  lib/MultipartWriter.js
View
@@ -141,4 +141,4 @@ core.mixin(MultipartWriter.prototype, {
}
});
-(module && (module.exports = MultipartWriter)) || (exports = MultipartWriter);
+module.exports = MultipartWriter;
6 lib/Response.js
View
@@ -19,8 +19,4 @@ var ResponseAccumulator = function (reston, encoding){
var proto = ResponseAccumulator.prototype;
-if(module){
- module.exports = ResponseAccumulator;
-}else{
- exports = ResponseAccumulator;
-}
+module.exports = ResponseAccumulator;
5 lib/Reston.js
View
@@ -194,7 +194,4 @@ core.mixin(Reston, {
file: FileStream
});
-if(module)
- module.exports = Reston;
-else
- exports = Reston;
+module.exports = Reston;
6 lib/deps/uuid.js
View
@@ -45,8 +45,4 @@ UUID.uuid = function (len, radix) {
return uuid.join('');
};
-if(module){
- module.exports = UUID;
-}else{
- exports = UUID;
-}
+module.exports = UUID;
Please sign in to comment.
Something went wrong with that request. Please try again.