Questions tagged [node-request]

A node.js NPM package for handling HTTP requests.

Request.js is a popular package for which offers a simple HTTP abstraction layer with a comprehensive API / library for handling a range of common uses when making requests.


Documentation:


As of Feb 11th 2020, request is fully deprecated. No new changes are expected to land. In fact, none have landed for some time.

For more information about why request is deprecated and possible alternatives refer to this issue.

332 questions
4
votes
1 answer

node.js HTTP request with automatic ntlm / kerberos authentication

Looking through npm all ntlm / kerberos modules seem to want a hard coded username and password when performing HTTP requests against a windows authenticated endpoint. Is it possible to use the credentials of the currently logged in user? e.g. In…
Fergal
  • 2,484
  • 2
  • 36
  • 48
4
votes
3 answers

Node+ElasticSearch: Sending a body on a GET request?

I am using Node.js and the request module to create a backend, and we've chose Elasticsearch as our data storage. All fine so far, except it seems Node doesn't support request bodies on GET requests? This is necessary for Elasticsearch's _search…
4
votes
1 answer

Node.js - Download & process Image with 'request' and 'node-canvas'

I'm using the request and node-canvas modules to try and download and process an image: var request = require('request'); var Image = require('canvas').Image; var url =…
Sunday Ironfoot
  • 12,840
  • 15
  • 75
  • 91
3
votes
0 answers

How to define dynamic route path using regex in Nuxt's serverMiddleware?

I'm trying to define a regex based dynamic path in Nuxt's serverMiddleware, but I'm not able to figure out how to achieve it because in the doc also there is no any mention about dynamic route. I want to achieve something like this, //…
3
votes
1 answer

UNABLE_TO_VERIFY_LEAF_SIGNATURE from request with Firebase functions node.js with Certificate (pfx)

I am trying to make a request from my Firebase function to a custom server that requires a certficate (.pfx). Based on this answer: Upload TLS client certificate to Firebase cloud functions My code is as follows: const functions =…
Sunkas
  • 9,542
  • 6
  • 62
  • 102
3
votes
1 answer

GitHub API - "Get contents" continually returning 404 for valid path

I'm using probot => https://probot.github.io/ I've been developing a GitHub application that analyses a specific .json file in a repo for changes to date strings. I do this by subscribing to the push event and watching it with a webhook. I am using…
captainrad
  • 3,760
  • 16
  • 41
  • 74
3
votes
1 answer

Stream binary file with http post

I'm using the request library to send a binary (pdf) file in the body of the request using http post (NOTE: This API does not accept multi-part forms). However, I have only been able to get it to work using fs.readFilesync(). For some reason,…
neuquen
  • 3,991
  • 15
  • 58
  • 78
3
votes
1 answer

How to send bearer token and x-www-form-urlencoded data using Node Request

I want to replicate this Postman call using the node module request. See screenshots. Screenshot Screenshot2 As shown in screenshot, in my request, I need to pass a bearer token as well as x-www-form-urlencoded values. I tried following the top 2…
NodeMaster
  • 85
  • 1
  • 5
3
votes
1 answer

HTTP Auth request fails in browser due to CORS, ok in Node

I'm stuck trying to diagnose a problem where a GET request with HTTP Basic Auth succeeds in Node, but fails in the browser. The problem manifests directly as a CORS failure (there's no Access-Control-Allow-Origin on the 401 page). request.js:119…
Steve Bennett
  • 114,604
  • 39
  • 168
  • 219
3
votes
2 answers

Lambda Function does not return until async request ends

I want to make a function that calls an API (third party) and returns immediately, but it is waiting for API response. Here is the code sample: var request = require('request'); // When I call functionOne it should trigger functionTwo and should…
3
votes
1 answer

Node JS callbacks with Alexa skill

I have a module that includes a request call, which doesn't appear to be getting executed. var request = require('request'); var Alexa = require('alexa-sdk'); var APP_ID = ; var self = module.exports = { handler : function…
3
votes
0 answers

Chunked encoding, streams and content-length

I need to upload a gzipped file. For performance in case my string gets too big I decided to use streams but ran into an issue with the server requiring a content-length header which cannot be calculated as the gzipping is inline. I then decided to…
cyberwombat
  • 38,105
  • 35
  • 175
  • 251
3
votes
1 answer

NodeJS: Do I need to end HTTP requests to save memory/CPU?

I've written a program in Node and Express, using Request to connect to an API and downloads a bunch of data (think 3,000 API requests) (all within the usage limits of the API, mind you). When running this in a Docker container, I'm getting a lot of…
JVG
  • 20,198
  • 47
  • 132
  • 210
3
votes
0 answers

NodeJS - getting Error: read ETIMEDOUT with ~3,000 http get requests

My app uses NodeJS, Express and Request. I'm downloading a bunch of data from an API (all within the API's usage limits). It's around 3,000 requests, and they all happen fairly simultaneously. After about 1,000 of those requests (which return data…
JVG
  • 20,198
  • 47
  • 132
  • 210
3
votes
1 answer

How to insert binary data into sql server using node-mssql

I'm downloading an image using node/request module, and I'm trying to figure out how to insert that image into a varbinary field in sql server using the node/mssql module. So far I have tried putting a cast into the insert statement, converting the…
Danny Ackerman
  • 997
  • 1
  • 10
  • 25
1 2
3
22 23