0.1.4 • Published 10 years ago

gulp-http-post v0.1.4

Weekly downloads
54
License
MIT
Repository
github
Last release
10 years ago

gulp-http-post

froked from zhso/gulp-post

NPMNPM

npm npm npm npm

bitHound Overall Score Inline docs Build Status Coverage Status

GitHub stars GitHub watchers

Post buffer to current url on pipe.

var post = require("gulp-http-post");

gulp.task("post",function(){
    gulp.src("src/**/*.js")
        .pipe(post("http://www.mysite.com/"))
        .pipe(gulp.dest("dist"));
});

Features

  • Custom post params
  • Support buffer encoding
  • Support current callback
  • Callback gets body string and full http response object as params

Installation

$ npm i gulp-http-post

Examples

  • Custom Options
var post = new require("gulp-http-post");

gulp.task("build",function(){
    var options = {
                encoding: "base64",
                callback: function (err, body, response) {
                    if(err){
                        console.error(err);
                    }else{
                        console.log(body);
                        console.log(response);
                    }
                },
                param1: "value1",
                param2: "value2"
                //...
    };
    gulp.src("src/**/*.js")
        .pipe(post("http://www.mysite.com/",options))
        .pipe(gulp.dest("dist"));
})

Options Format

  • options.content file content
  • options.encoding buffer.toString() encoding
  • options.relative file relative
0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago