Questions tagged [node-rest-client]

39 questions
4
votes
1 answer

how to get values in form-data from postman addon nodejs express

I am using node js with express framework, restful api. I want to post values using 'form-data' option in postman addon. I am able to post values using the x-www-form-urlencoded option and am able to get values like req.body.username,…
raj
  • 305
  • 1
  • 3
  • 16
2
votes
0 answers

From Node.js how to call REST API that uses ASP.NET web API windows authentication?

I am using request npm package to call api that uses windows authentication. I make call to GET method as below. But I get 401 UNAUTHORIZED as response code. var request = require('request'); var options = { url: 'http://url', method : 'GET', …
Thangakumar D
  • 567
  • 3
  • 9
  • 21
2
votes
0 answers

PDF file gets corrupted if data is acquired through $http.get() but remains intact if acquired through $http.post() in Angular

Recently I have a faced a peculiar problem while doing some development involving some interaction with Node Web-API and AngularJS front-end application. I have written an NodeJS Web-API that hits another ASP.NET Web Service and gets some pdf data.…
2
votes
1 answer

Upload and redirect page using multer

I am having a problem to redirect the page after a successful file upload using multer. With the file upload i am also saving some text into the database. Here's my code. Question : When the file and the contents are saved in the DB how can I…
Illep
  • 14,274
  • 40
  • 148
  • 258
2
votes
1 answer

Jelastic API intermittent session authentication error "not authenticated (different session key)"

I have created the below script to pull stats from the Jelastic api so i can gather resource stats over a time. The end goal is to log the data to a spreadsheet. Below is my code that handles authenticating and then making the request to…
dlearious
  • 291
  • 1
  • 3
  • 9
2
votes
1 answer

PUT/ update operation fails in $resource AngularJS client in rest based app (mongoose insert / update issue).

I am new to MEAN applications.Here I have a REST based sample application using node-restful library in which I can perform operations(get,save,delete) except 'put'. However 'put' operation works well on rest clients (advanced REST, postman) but not…
2
votes
1 answer

How can I cache oAuth token across API calls in node.js

I have been able to set my code up so that when you make a request to an api function an oAuthHandler function automatically handles authentication for you. The problem I am having though is that I can't find a way to cache the token across multiple…
MrCrowly
  • 168
  • 1
  • 13
1
vote
1 answer

Using axios with Node to get a picture jpg

I'm trying to get a picture [via Node http get request] from another Node app, using axios. The problem is that when I use axios I get bad format of the file and when I save it, it doesnt look lime a picture... When I use http get, I get a perfect…
moshi
  • 230
  • 4
  • 13
1
vote
1 answer

Make Node REST Client expect UTF-8 JSON content to avoid BOM parsing error

I have a Node.js application using Node REST Client to make an HTTP GET request to a server, targeting a file in JSON format. Everything goes well when this file is encoded in UTF-8 without BOM. However, the app crashes during the client.get call…
Batman
  • 212
  • 2
  • 12
1
vote
1 answer

send multiple files into git repository

I want to send multiple files into git repository using nodejs. its moving single file only. when looping its throwing error like Cannot set headers after they are sent to the client. below is my code. suggest me where I did wrong. var base64 =…
Jay
  • 97
  • 1
  • 8
1
vote
0 answers

"invalid_request ... Missing grant type" when calling certain OAuth2 from NodeJs but not from curl with exact same header

I am very confused why I am getting "Missing grant type" error from Spring Security OAuth2 while calling it from NodeJs node-rest-client. I checked via "sniffer" and I can see I am posting exact the same header and body. Well, the only difference I…
DemeCarvO
  • 367
  • 2
  • 10
  • 25
1
vote
1 answer

How to test a call to a REST service

I set up a server that provides several endpoints to clients, and I have a client that uses node-rest-client package to post data to the backend. I would like to write some unit-testing for the client side, making sure the data is properly sent to…
Kesem David
  • 1,879
  • 3
  • 19
  • 44
1
vote
1 answer

node.js https POST with body-attributes - HOW?

I am trying to get a Token with my node.js server. The code below gets executed when someone calls the REST-API of my server (within the processing of this call the server makes several calls himself). The following configuration works in…
IntegerWolf
  • 1,103
  • 1
  • 8
  • 21
0
votes
0 answers

Node js REST Client Scaling the Data collection

I have a scenario where my node js client collects data from rest api. Scenario : my api endpoint is like this http://url/{project} where project is parameter. the project comes from a Database table. here is my procedure: I am getting all the…
0
votes
0 answers

Is there a Node.js pattern for making per-user authenticated REST client calls?

I have a bit of a design challenge. I'm building a web portal that unifies a couple of secondary REST APIs into a single web interface. The backend is a Node.js REST API with a React frontend. I have authentication support added, and the user…
dubmojo
  • 5,753
  • 8
  • 36
  • 61
1
2 3