Questions tagged [requestjs]

Request - Simplified HTTP client

Request is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default.

var request = require('request');
request('http://www.google.com', function (error, response, body) {
  if (!error && response.statusCode == 200) {
    console.log(body) // Show the HTML for the Google homepage.
  }
})

Available Options

  • Streaming
  • Forms
  • HTTP Authentication
  • Custom HTTP Headers
  • OAuth Signing
  • Proxies
  • Unix Domain Sockets
  • TLS/SSL Protocol
  • Support for HAR 1.2

Request in GitHub

Request in npm


Deprecated Warning!

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.

143 questions
0
votes
1 answer

Nodejs library RequestJS undefined MULTER req.files.fileName.path when use ExpressJS routes

I got a problem with Multer, undefined req.files.path field First, my Express.js route is: routes.js router.post('/', function(req, res, next){ // id, name, usersArray[], info, iconImg, headerImg var dataObject = new…
JavaJedi
  • 221
  • 5
  • 16
0
votes
1 answer

how to ensure request is done sequentially?

I'd like to request one page after another, the following code seems request all the pages in the same time, is there a way to fetch one page after the previous one is done? thanks var Promise = require("bluebird"); var request =…
AngeloC
  • 3,213
  • 10
  • 31
  • 51
-1
votes
1 answer

How to save a file sent from NodeJS with POST

I created the following function to load a stream file. This stream is sent to the address specified with a POST. At the destination, I have another NodeJS service that with ExpressJS "capture" this POST but I have no idea how I can save the file to…
shogitai
  • 1,823
  • 1
  • 23
  • 50
-1
votes
2 answers

Find JSON is Changed in JSON Object

I'm working request data from a URL for every seconds exports.getFootballNotRunning = function (callback) { request({ method: 'GET', url: 'http://ufxyz.ufabet.com/_View/RMOdds1Gen.ashx?ot=t&sort=0&at=EU', }, function (error, response, body)…
-1
votes
1 answer

Module Export callback function returns undefined

Hello: i am new to nodejs and mocha. I trying to use module.exports to return a value from a callback function. However, its returning undefined. For simple cases it works though. Please help. Result Module Export Example √ Test Case 1:…
Bipo K
  • 395
  • 3
  • 20
-1
votes
1 answer

Access content of JSON object

I am attempting to access the content of a JSON object returned from an API call in order to set variables. var request = require('request'); var apiOptions = { server : "http://localhost:3000" }; var renderAdminLanding = function(req, res,…
Tyler B. Joudrey
  • 421
  • 1
  • 8
  • 22
-1
votes
1 answer

set encoding false in querystring in node.js

sorry if the question seems to be meaningless, i just want to make sure is there a way or any solution for this. Any Help is appreciated request({url:url, search:qs}, function(e,r,body) { qs:{ name: 'Rome||Turin||venice||milan'} }) is their a…
terik_poe
  • 523
  • 4
  • 17
-1
votes
1 answer

RequestJS pass a content-type: application/json

I'm looking a way to pass a content-type in RequestJS using with Nodejs. Right now I have this as params: 'use strict'; request = require('request'), app.register = function(req, res) { request.post({ headers: {'Content-Type' :…
Ryan
  • 13
  • 1
  • 4
1 2 3
9
10