Tabnine Logo For Javascript
Request
Code IndexAdd Tabnine to your IDE (free)

How to use
Request
in
request

Best JavaScript code snippets using request.Request(Showing top 15 results out of 5,391)

origin: sx1989827/DOClever

return new Promise(function (resolve) {
  var imgPath=path.join(con.filePath,"img",uuid()+".png");
  var pipe=request(url).pipe(fs.createWriteStream(imgPath))
  pipe.on("finish",function () {
    var filePath=imgPath;
origin: eashish93/imgsquash

.on('response', (resp) => {
.on('error', (err) => {
  log.warn(err, 'Error into getting url. Route: /dl/:id');
  return errors.internalServer(res);
origin: paschmann/rasa-ui

  sendOutput(500, res, '{"error" : ' + err + '}');
}).pipe(fs.createWriteStream(model.file_path + model.file_name));
origin: o2team/athena

req
   .pipe(fs.createWriteStream(tmpzip))
   .on('finish', function() {
    var decompress = require('decompress');
origin: o2team/athena

console.log(chalk.green('  正在下载最新的模板,请稍等...'));
request(setting.report_url + '/api/template/download')
.pipe(fs.createWriteStream(_tmppath))
.on('finish',function(){
 md5File(_tmppath, function(err, sum) {
origin: eashish93/imgsquash

request
  .get(url.href)
  .on('response', (resp) => {
  .on('end', () => {
    if(isResponseSent) return;
    if(isMaxFileSizeExceed)
origin: torreyleonard/algotrader

/**
   * Stop the streaming class.
   * @author Torrey Leonard <https://github.com/Ladinn>
   * @author Wyatt Calandro <https://github.com/wclandro>
   */
  stop() {
    this.request.abort();
    if(this.iex){
      this.socket.disconnect();
    }
  }
origin: tencentyun/cos-nodejs-sdk-v5

// kill task
  var killTask = function (data) {
    if (data.TaskId === TaskId) {
      readStream && readStream.isSdkCreated && readStream.close && readStream.close(); // 如果是 SDK 里从 FilePath 创建的读流,要主动取消
      sender && sender.abort && sender.abort();
      self.off('inner-kill-task', killTask);
    }
  }
origin: cmints/cmints

function downloadProject(projectUrl, callback)
{
 ensureDirSync(tempDir);
 console.log("Downloading example project...");
 request(projectUrl).pipe(fs.createWriteStream(tempZip)).on("close", () =>
 {
  callback();
 });
}
origin: ChriD/node-raumkernel

abortZoneConfigurationRequest()
  {
    if(this.zoneConfigRequestObject)
      this.zoneConfigRequestObject.abort()
    this.zoneConfigRequestStarted = false
  }
origin: t-rekttt/fb_stickers_crawler

let download = (url, path) => {
 return new Promise(cb => {
  original_request(url).pipe(fs.createWriteStream(path)).on('finish', cb);
 });
}
origin: jesperorb/node-api-proxy

app.use('/', function(req, res) {

 //Take the baseurl from your api and also supply whatever 
 //route you use with that url
 let url =  config.apiUrl + req.url;
 let query = config.assignKey(req.query);

 //Pipe is through request, this will just redirect 
 //everything from the api to your own server at localhost. 
 //It will also pipe your queries in the url
 req.pipe(request({ qs: query , uri: url })).pipe(res);
});
origin: xlzy520/nodejs-examples

async function downloadUrl(urlAudio) {
 const arg = url.parse(urlAudio);
 const fileName = arg.pathname.split('/').slice(-1)[0];
 const download_dstpath =  './' + fileName
 request(urlAudio).pipe(fs.createWriteStream(download_dstpath))
 return new Promise((resolve, reject) => {
  setTimeout(()=>{
   resolve()
  }, 500)
 })
}
origin: nayrnet/node-dahua-api

request(BASEURI + '/cgi-bin/ptz.cgi?action=' + action + '&channel=0&code=' + direction + '&arg1=' + speed +'&arg2=' + speed + '&arg3=0', function (error, response, body) {
  if ((error) || (response.statusCode !== 200) || (body.trim() !== "OK")) {
   self.emit("error", 'FAILED TO ISSUE PTZ UP COMMAND');
  }
 }).auth(USER,PASS,false);
origin: marvinpinto/ledger-reconciler

const downloadHugo = () => {
 if (!fs.existsSync(hugoBinary)) {
  return request(hugoUrl)
   .pipe(source('hugo.tar.gz'))
   .pipe(streamify(decompress({strip: 1})))
   .pipe(gulp.dest('tmp'));
 }
 return Promise.resolve();
}
request(npm)Request

Most used request functions

  • request
  • Response.statusCode
  • RequestAPI.post
  • RequestAPI.get
  • Request.pipe
  • rp,
  • Request.on,
  • Response.headers,
  • RequestAPI.defaults,
  • RequestAPI.put,
  • RequestAPI.jar,
  • Response.statusMessage,
  • RequestAPI.head,
  • Response.on,
  • RequestAPI.cookie,
  • RequestAPI.delete,
  • Response.pipe,
  • RequestAPI.del,
  • requestRetry

Popular in JavaScript

  • glob
    a little globber
  • mocha
    simple, flexible, fun test framework
  • ws
    Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js
  • chalk
    Terminal string styling done right
  • lodash
    Lodash modular utilities.
  • mkdirp
    Recursively mkdir, like `mkdir -p`
  • postcss
  • express
    Fast, unopinionated, minimalist web framework
  • request
    Simplified HTTP request client.
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now