Questions tagged [needle.js]

Nimble, streamable HTTP client for Node.js. With proxy, iconv, deflate & multipart support.

Needle is a nimble, streamable HTTP client for Node.js, with proxy, iconv, deflate & multipart support.

Project home page: https://github.com/tomas/needle

29 questions
1
vote
1 answer

How can I return value after get-request in node.js?

How can I get this value when I get a response from the server? The terminal is not outputing any information when I run it. console.log(a); function findMaxID() { var a = needle.get(URL, function(err, res){ if (err) throw err; …
1
vote
1 answer

Exception stopping execution even inside a try-catch block

I have a bit of code that loops through a list of URLs and fetches them using needle, I am having a problem as it seems if one of the URLs is malformed needle throws a URIError that stops the execution. What I want is for the bad URL to be marked…
Haddad
  • 369
  • 1
  • 2
  • 9
1
vote
3 answers

Handle successful HTTP promise if one fails in Bluebird

I'm fairly new to Promises and have been attempting to get this piece of code to work properly. Here's what I have. var Promise = require('bluebird'); Promise.join(getProducts, getPricing, function(products, pricing) { …
lionpants
  • 1,469
  • 14
  • 24
1
vote
1 answer

needle : node.js returning 500 on POST

I have my own rest API, that internally calls an NLP API, for which I have to post some data on their URL. I am using needle to achieve this, but there's some error that I cannot catch, and my own api is returning 500 to the frontend. Here is that…
user000111181
  • 403
  • 7
  • 20
0
votes
0 answers

How to parse a website using axios on heroku with cookies enabled?

I have such a problem... I need to parse a certain page of the site.For this I used axios or needle. The problem is that when I run the project locally and want to get the data, everything works fine. But when I run the project on heroku and call…
Ilya K
  • 93
  • 8
0
votes
2 answers

Running http module in express route - NodeJS

I want to render some HTML text within my express route. I know one of the options is using the npm-needle module but I was unsure if we there is any way to use npm-express and npm-http within the same route defined. What I want is something…
Abhinav Sharma
  • 147
  • 2
  • 9
0
votes
0 answers

microservice with node and needle

I'm trying to make my monolithic application written in node and express to a microservice application in node, needle(to communicate between microservices) and express. My architecture is as follows, I have a microservice called gateway_service…
fad
  • 43
  • 1
  • 9
0
votes
1 answer

Structure of object is being modified during POST request

So I send a post request using needle with the following object as body: { time: 1533725993910, rconPort: 52940, rconPassword: 'muqrxllv', serverPort: 38950, unique: 795571399, publicIP: 'localhost', mods: [ { modName:…
Daniel Vestøl
  • 480
  • 7
  • 16
0
votes
1 answer

Node JS Needle Post Response Body Returned as Buffer

I am currently trying to call a remote API from a node.js application that I am writing using needle. The API requires that I make all requests as post requests. when I try to print out the response.body in the console log the only thing that prints…
DavidShepard
  • 306
  • 3
  • 11
0
votes
3 answers

Requesting large JSON objects lead to memory leak

I have a simple NodeJs application that acts as a REST client and requests large JSON object. The problem is that it always runs out of memory (taking more than 6Gb). I am using manual garbage collection (app started with --expose_gc) but that…
Jkam
  • 1
0
votes
1 answer

Multiple POST params in node.js POST, using needle

I am trying to POST some data to this API end point , Corresponding curl call is this : curl -X POST \ -d "apiKey=YOU_API_KEY" \ -d "extractors=entities,entailments" \ -d "text=Spain's stricken Bankia expects to sell off its vast…
user000111181
  • 403
  • 7
  • 20
0
votes
1 answer

How to curl/needle/request google.flight correctly?

I want to parse the page (https://www.google.com/flights/#search;f=JFK;t=SFO;d=2014-12-22;r=2014-12-30) on my backend using needleJs(https://github.com/tomas/needle) and Cheerio(https://github.com/cheeriojs/cheerio). When I tried to request the…
Hao
  • 1,476
  • 3
  • 15
  • 20
-1
votes
0 answers

How can i fetch csv file in nodejs from nseindia.com?

Problem is link being not accessible to nodejs get client. Could be some headers issue or something. Problem is with 'https://www.nseindia.com/api/reportASM?csv=true' link. This link works on nseindia website https://www.nseindia.com/reports/asm I…
-1
votes
1 answer

Redirect the user to the URL of REST API after sending the post request using Needle

I am working with a REST API that as a result of a POST request to an address like https://example.com/api returns an HTML webpage (instead of JSON or other data formats). Normally on the front-end side dealing with such scenario is not difficult to…
asajadi84
  • 410
  • 5
  • 20
1
2