endpointsjs
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -35,3 +35,3 @@ # Endpoints API Reference | ||
## endpoint.set(headerName, headerValue) | ||
## endpoint.header(headerName, headerValue) | ||
@@ -41,5 +41,13 @@ Set an HTTP request header. Returns the `endpoint`. | ||
```javascript | ||
endpoint.set('Content-Type', 'application/json'); | ||
endpoint.header('Content-Type', 'application/json'); | ||
``` | ||
## endpoint.contentType(mimeType) | ||
Sugar method for `endpoint.header('Content-Type', mimeType)` | ||
## endpoint.accepts(mimeType) | ||
Sugar method for `endpoint.header('Accepts', mimeType)` | ||
## endpoint.thenApply(onFullfilled, onError, onProgress) | ||
@@ -157,2 +165,18 @@ | ||
## method.header(headerName, headerValue) | ||
Set an HTTP request header. Returns the `method`. | ||
```javascript | ||
method.header('Content-Type', 'application/json'); | ||
``` | ||
## method.contentType(mimeType) | ||
Sugar method for `method.header('Content-Type', mimeType)`. | ||
## method.accepts(mimeType) | ||
Sugar method for `method.header('Accepts', mimeType)` | ||
## method.thenApply(onFullfilled, onError, onProgress) | ||
@@ -159,0 +183,0 @@ |
# [Changelog](https://github.com/kahnjw/endpoints/releases) | ||
## 0.3.1 | ||
* Add sugar method Endpoint.contentType | ||
* Add sugar method Endpoint.accepts | ||
* Add sugar method Method.contentType | ||
* Add sugar method Method.accepts | ||
## 0.3.0 | ||
@@ -4,0 +11,0 @@ |
{ | ||
"name": "endpointsjs", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Simple library for HTTP service clients", | ||
@@ -45,6 +45,6 @@ "main": "src/index.js", | ||
"shmock": "0.7.x", | ||
"chai": "~1.9.1", | ||
"chai": "1.9.1", | ||
"gulp-jshint": "1.6.x", | ||
"karma-spec-reporter": "0.0.13", | ||
"chai-as-promised": "~4.1.1" | ||
"chai-as-promised": "4.1.x" | ||
}, | ||
@@ -55,5 +55,4 @@ "dependencies": { | ||
"superagent": "0.18.x", | ||
"path": "~0.4.9", | ||
"requestadapter": "0.0.4" | ||
} | ||
} |
@@ -74,2 +74,10 @@ 'use strict'; | ||
Create.prototype.contentType = function(mimeType) { | ||
return this.header('Content-Type', mimeType); | ||
}; | ||
Create.prototype.accepts = function(mimeType) { | ||
return this.header('Accepts', mimeType); | ||
}; | ||
Create.prototype.getDomain = function() { | ||
@@ -76,0 +84,0 @@ return this._domain; |
@@ -25,2 +25,10 @@ 'use strict'; | ||
Method.prototype.contentType = function(mimeType) { | ||
return this.header('Content-Type', mimeType); | ||
}; | ||
Method.prototype.accepts = function(mimeType) { | ||
return this.header('Accepts', mimeType); | ||
}; | ||
Method.prototype.param = function(key, value) { | ||
@@ -27,0 +35,0 @@ this.params[key] = value; |
28467
4
516
- Removedpath@~0.4.9
- Removedpath@0.4.10(transitive)