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

How to use
close
function
in
Curl

Best JavaScript code snippets using node-libcurl.Curl.close(Showing top 4 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

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: 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)Curlclose

Most used node-libcurl functions

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

Popular in JavaScript

  • request
    Simplified HTTP request client.
  • yargs
    yargs the modern, pirate-themed, successor to optimist.
  • debug
    small debugging utility
  • crypto
  • superagent
    elegant & feature rich browser / node HTTP with a fluent API
  • commander
    the complete solution for node.js command-line programs
  • mocha
    simple, flexible, fun test framework
  • q
    A library for promises (CommonJS/Promises/A,B,D)
  • winston
    A logger for just about everything.
  • Top Sublime Text 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