gh-put
v1.0.0
Published
Create a PUT request to the Github API
Downloads
7
Maintainers
Readme
gh-put
A Node module to create a PUT
request to the Github API
const ghPut = require('gh-put');
ghPut('gists/2790533/star', {
headers: {
'user-agent': 'your application name'
},
token: 'your access token'
}).then(response => {
response.headers.status; //=> '204 No Content'
console.log('Successfully starred https://gist.github.com/domenic/2790533');
});
Installation
npm install gh-put
API
const ghPut = require('gh-put');
ghPut(url [, options])
url: String
("path" part of a Github API URL)
options: Object
(gh-get
options)
Return: Object
(Promise
instance)
Almost the same as gh-get, except that the method
option defaults to 'PUT'
and unchangable.
License
Copyright (c) 2015 Shinnosuke Watanabe
Licensed under the MIT License.