Tabnine Logo For Javascript
Curl.on
Code IndexAdd Tabnine to your IDE (free)

How to use
on
function
in
Curl

Best JavaScript code snippets using node-libcurl.Curl.on(Showing top 5 results out of 315)

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

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) {
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)Curlon

Most used node-libcurl functions

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

Popular in JavaScript

  • express
    Fast, unopinionated, minimalist web framework
  • axios
    Promise based HTTP client for the browser and node.js
  • mongodb
    The official MongoDB driver for Node.js
  • lodash
    Lodash modular utilities.
  • 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.
  • redis
    Redis client library
  • debug
    small debugging utility
  • q
    A library for promises (CommonJS/Promises/A,B,D)
  • mocha
    simple, flexible, fun test framework
  • Best IntelliJ 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