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

How to use
Curl
in
node-libcurl

Best JavaScript code snippets using node-libcurl.Curl(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")
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)Curl

Most used node-libcurl functions

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

Popular in JavaScript

  • fs
  • async
    Higher-order functions and common patterns for asynchronous code
  • crypto
  • axios
    Promise based HTTP client for the browser and node.js
  • lodash
    Lodash modular utilities.
  • moment
    Parse, validate, manipulate, and display dates
  • through2
    A tiny wrapper around Node.js streams.Transform (Streams2/3) to avoid explicit subclassing noise
  • express
    Fast, unopinionated, minimalist web framework
  • cheerio
    Tiny, fast, and elegant implementation of core jQuery designed specifically for the server
  • Top PhpStorm 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