Tabnine Logo For Javascript
node-libcurl
Code IndexAdd Tabnine to your IDE (free)

How to use node-libcurl

Best JavaScript code snippets using node-libcurl(Showing top 8 results out of 315)

origin: VeliovGroup/request-extra

process.nextTick(() => {
  if (!libcurl.finished) {
   curl.perform();
  }
 });
origin: unreleased/request-curl

curl.setOpt(Curl.option.DEBUGFUNCTION, (infoType, content) => {
     if (infoType == 0) {
      console.log(Buffer.from(content).toString().trim())
     }
    })
origin: unreleased/request-curl

curl.on("error", function (err) {
    curl.close.bind(curl)
    this.close()
    reject(err)
   })
origin: VeliovGroup/request-extra

curl.on('data', (data) => {
   libcurl.pipeTo.write(data);
  });
origin: VeliovGroup/request-extra

process.nextTick(() => {
     libcurl.finished = true;
     curl.close();
     cb(badRequestError);
    });
origin: VeliovGroup/request-extra

curl.on('end', (statusCode, body, _headers) => {
  libcurl._debug('[END EVENT]', opts.retries, url.href, finished, statusCode);
  stopRequestTimeout();
  if (finished) { return; }

  finished = true;
  if (libcurl.pipeTo) {
   libcurl.pipeTo.end();
  }
  curl.close();

  const headers = {};
  if (_headers && _headers[0]) {
   delete _headers[0].result;
   for (let headerName in _headers[0]) {
    if (_headers[0][headerName]) {
     headers[headerName.toLowerCase()] = _headers[0][headerName];
    }
   }
  }

  cb(void 0, {statusCode, status: statusCode, body, headers});
 });
origin: unreleased/request-curl

curl.on("end", async function (statusCode, data, headers) {
    if (options.followRedirects && curl.getInfo("REDIRECT_URL")) {
     options.redirectCount = options.redirectCount + 1 || 1
     if (options.redirectCount != options.maxRedirects) {
      options.uri = curl.getInfo("REDIRECT_URL")
      this.close()
      return resolve(new Request(options))
    this.close()
origin: VeliovGroup/request-extra

curl.on('error', (error, errorCode) => {
  libcurl._debug('REQUEST ERROR:', opts.retries, url.href, {error, errorCode});
  stopRequestTimeout();
  if (finished) { return; }

  finished = true;
  curl.close();

  let statusCode = 408;
  if (errorCode === 52) {
   statusCode = 503;
  } else if (errorCode === 47) {
   statusCode = 429;
  } else if (errorCode === 60 || errorCode === 91) {
   statusCode = 526;
  }

  error.code       = errorCode;
  error.status     = statusCode;
  error.message    = typeof error.toString === 'function' ? error.toString() : 'Error occurred during request';
  error.errorCode  = errorCode;
  error.statusCode = statusCode;

  cb(error);
 });
node-libcurl(npm)

Most used node-libcurl functions

  • Curl.close
  • Curl.on
  • Curl.getInfo
  • Curl.option
  • Curl.perform
  • CurlOption.DEBUGFUNCTION,
  • bind,
  • close

Popular in JavaScript

  • ms
    Tiny millisecond conversion utility
  • body-parser
    Node.js body parsing middleware
  • request
    Simplified HTTP request client.
  • colors
    get colors in your node.js console
  • webpack
    Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
  • mkdirp
    Recursively mkdir, like `mkdir -p`
  • superagent
    elegant & feature rich browser / node HTTP with a fluent API
  • redis
    Redis client library
  • http
  • CodeWhisperer alternatives
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