Skip to content

Commit 67006f1

Browse files
author
Julien M
committed
0.1.7
1 parent 2bd9de2 commit 67006f1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,18 @@ The field name of the file to be uploaded, on the API side.
114114
#### Default Options
115115
In this example, the default POST method is used to upload the local picture `./images/status.jpg` to Basecamp. Their API can be accessed through the URL `https://basecamp.com` (using Basic Auth). When creating an attachment in Basecamp, the "dest" field name is not important, so you can set it to anything (`img` in this case).
116116
`method` is set to "POST", but could have been omitted as this is the default value.
117+
The `onComplete` method is then used to display API's response.
117118

118119
```js
119120
grunt.initConfig({
120121
http_upload: {
121122
basecamp: {
122123
options: {
123124
url: 'https://user:pwd@basecamp.com/99999999/api/v1/attachments.json',
124-
method: 'POST'
125+
method: 'POST',
126+
onComplete: function(data) {
127+
console.log('Response: ' + data);
128+
}
125129
},
126130
src: 'images/status.jpg',
127131
dest: 'img'
@@ -137,9 +141,9 @@ You should fork this repo, and issue a Pull Request with your proposed changes.
137141

138142
### Roadmap ideas
139143
For now the upload is limited to 1 file per target. This could change if I find a scenario needing it.
140-
Also, it is not possible to add additional payload (no custom data).
141144

142145
## Release History
146+
- 0.1.7 - 2014-12-30: Add onComplete as an optional callback function used to process server's response. (PR from [Remigiusz Jackowski](https://github.com/remiq)).
143147
- 0.1.6 - 2014-10-13: Add rejectUnauthorized option to bypass SSL certificate verification (PR from [GODDET](https://github.com/GODDET)).
144148
- 0.1.4/0.1.5 - 2014-05-25: Upload success on all 2XX codes (PR from [Shane Smith](http://github.com/shanesmith)) + Fix.
145149
- 0.1.3 - 2014-05-14: Added a headers option to send HTTP headers (PR from [Andrey Okonetchnikov](http://github.com/okonet)).

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "grunt-http-upload",
33
"description": "Grunt plugin to upload files through POST/PUT HTTP request",
4-
"version": "0.1.6",
4+
"version": "0.1.7",
55
"homepage": "https://github.com/DiscoverGrunt/grunt-http-upload",
66
"author": {
77
"name": "Julien M",

0 commit comments

Comments
 (0)