Comparing version 1.1.0-alpha-01 to 1.1.0-alpha-02
{ | ||
"name": "shred", | ||
"version": "1.1.0-alpha-01", | ||
"version": "1.1.0-alpha-02", | ||
"description": "A resource-oriented JavaScript HTTP client.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -121,1 +121,25 @@ # Overview | ||
Subresources defined using URL templates will be functions, allowing you to pass in an object whose key-value pairs will instantiate the template. | ||
### Shred Responses | ||
When you invoke a Shred request functions, you get back a response context. This contains both the HTTP response object and a data object. The data object is a promise that resolves when the response body is finished streaming. If the `content-type` appears to be JSON-based, Shred will parse the response body as JSON and return an object, otherwise, it will return a string. | ||
### Explicit Invocation | ||
You can explicit invoke Shred request functions using the `invoke` command. This is particularly useful when using helper functions defined on the request function, such as `authorize`. | ||
### Authorization With Shred | ||
You can use the `authorization` method defined on request functions to pass authorization information into the request. The `authorization` function takes a object describing the authorization scheme. Currently, `basic` and `bearer` are supported. | ||
#### Example | ||
```coffeescript | ||
try | ||
yield github | ||
.repo {owner, repo} | ||
.issues | ||
.create | ||
.authorize basic: {username: token, password: ""} | ||
.invoke {title, body} | ||
``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
20864
145
1