0.2.1 • Published 8 years ago

gulp-http-put v0.2.1

Weekly downloads
43
License
MIT
Repository
github
Last release
8 years ago

gulp-http-put

NPMNPM

npm npm npm npm

bitHound Overall Score Inline docs Build Status Coverage Status

GitHub stars GitHub watchers

Makes an HTTP PUT for each file on the selected URL. I allows to define custon options that will be passed to request module.

Features

  • Custom PUT params via request module
  • Support callback method
  • Raises error when failing

Installation

$ npm install gulp-http-put --save-dev

Examples

  • Put with custom options and callback
var put = require("gulp-http-put");

gulp.task("put",function(){
    gulp.src("src/**/*.js")
        .pipe(put("http://www.mysite.com/",
			{
				"headers": {
                	"Custom-Header": "This is a custom HTTP header"
                },
                "callback": function(err, response, body) {
					if(!err) {
					    //yor code
					}
				}
			}
        ));
});

Options Format

Options used by request module. For example:

  • options.callback Callback function called with error, response, body params.
  • options.headers Headers added to the request HTTP PUT message