Questions tagged [node-rest-client]

39 questions
4
votes
2 answers

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
  • 356
  • 1
  • 5
  • 20
3
votes
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
  • 280
  • 4
  • 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
  • 714
  • 5
  • 12
  • 27
2
votes
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
  • 487
  • 4
  • 16
  • 28
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

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
  • 2,135
  • 3
  • 27
  • 46
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
  • 16,375
  • 46
  • 171
  • 302
2
votes
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,232
  • 1
  • 11
  • 21
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
  • 331
  • 2
  • 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
  • 2
  • 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
  • 282
  • 3
  • 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
  • 187
  • 2
  • 13
0
votes
0 answers

Rest api - Mask sensitive fields in api response

Is there a library that masks sensitive fields(encrypts with random characters) in Rest API response. The masked data should be sent back to the UI. And if UI sends the masked data back in consecutive requests, it should be again unmasked and send…
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…
1
2 3