Questions tagged [superagent]

410 questions
1
vote
1 answer

Getting connect ECONNREFUSED 127.0.0.1:80 error when running supertest

My student got a connect ECONNREFUSED 127.0.0.1:80 error when running the following test: it("returns status code 200", () => { return request(app) .get("./about") .expect(200) }); My student is using supertest for HTTP assertions on…
jsstrn
  • 443
  • 1
  • 4
  • 13
1
vote
1 answer

How to fix grant_type error is NULL - unsupported grant type with Pay Pal's REST API for access token

I'm calling Paypal's REST API to get an access token https://developer.paypal.com/docs/api/overview/#get-an-access-token I'm using node with superagent to make the AJAX call. Here is my code: const basicAuth =…
Shlomo
  • 43
  • 1
  • 6
1
vote
1 answer

How to configure supertest to not parse the response body?

I'm using supertest to implement a batch of canary tests for a quirky Web API that I don't control. One of the API's quirks consists of returning a plaintext string in a response that declares the Content-Type to be application/json. This…
RAM
  • 2,257
  • 2
  • 19
  • 41
1
vote
0 answers

Problem with my api call on react ' http://localhost/https://myapiurl.com '

i try to call api with superagent in my react app like this : import superagentPromise from 'superagent-promise'; import _superagent from 'superagent'; import { Base64 } from 'js-base64'; const API_ROOT = 'https//myapiurl.com/api'; const…
Dd Vivi
  • 11
  • 3
1
vote
1 answer

Superagent .attach() file or buffer data is empty

I ran into this issue where superagent does not properly attach a file or a buffer into the request and the reason I mentioned empty is due to the form data looking like : ------WebKitFormBoundaryy6T3XReWRFT1KfFm Content-Disposition: form-data;…
moodseller
  • 212
  • 2
  • 14
1
vote
2 answers

React Native video file upload

I am currently uploading videos and images using base64 encoding but it was highly recommended to use an alternative to this. I am using RNFetchBlob to read the encoded file and then attach it to SuperAgent for uploading. I have seen some examples…
Victor Altadonna
  • 193
  • 2
  • 10
1
vote
0 answers

superagent: is a file exist?

with the code below I can start downloading file: var stream = fs.createWriteStream('file.zip'); request.get('http://example.com/file.zip').pipe(stream); how can I check that file exist with superagent without downloading it?
kharandziuk
  • 12,020
  • 17
  • 63
  • 121
1
vote
0 answers

NodeJS - Superagent. SSL23_GET_SERVER_HELLO when try GET method over HTTPS

Following the documentation of an API Service, I have found out that I have to make request to the following URL https://eipapp1.emeter.com:9674 I am using superagent module of Node.JS. And I am getting the following error: Error: write EPROTO…
Luis González
  • 3,199
  • 26
  • 43
1
vote
1 answer

What is wrong with my timestamp in my MWS request?

If I submit a request to MWS via the scratchpad(AmazonServices/Scratchpad), it is successful, and I am able to view the details of the successful request. In particular, the timestamp on the request looks like this:…
adam tropp
  • 674
  • 7
  • 22
1
vote
0 answers

nodejs: read ECONNRESET

I am developing a Web crawl program for fun, but when i use superagent to get page, read ECONNRESET occurred. const https = require('https'); https.globalAgent.options.secureProtocol = 'TLSv1_2_method'; const superagent =…
1
vote
1 answer

How to Export Data Outside .then() Block (SuperAgent Library)?

I have two files on my Nodejs project that depends on each other. I use a simple library called SuperAgent (I need it) SuperAgent Library Links in file1.js const file2 = require('./file2'); let callMe = async (x) => { const resData = await…
xcode
  • 1,637
  • 3
  • 16
  • 25
1
vote
0 answers

Superagent .attach throws error code 500

I want to upload a picture from phone (android) to a server (Editing avatar of a profile). To select the picture i am using react-native-image-picker. This is my API-Call request .post(apiurl) .set("auth", token) .attach('avatar', avatar) …
Manzn
  • 159
  • 2
  • 7
1
vote
1 answer

Catch superagent request error before piping

I'm trying to pipe a file from service A trough service B into my Postman cliente. Service A builds an delivers a CSV file, and service B (nodejs) has to pipe into my client. After researching a lot I have managed to successfully pipe the files into…
Sebastialonso
  • 1,437
  • 18
  • 34
1
vote
1 answer

nested api calls when iterating over data

I'm following the same steps as "A simplified approach to calling APIs with redux" to do api calls. However i'm attempting to do a nested call when i get my results but the for loop is not waiting so my returned data is all in the wrong place. i'm…
Adam
  • 1,136
  • 8
  • 26
  • 51
1
vote
1 answer

ReactJS: show modal with loading message during superagent ajax request

I'm having trouble showing a modal dialog with loading message during ajax request(with superagent). I have a reactjs app that has a single input field, a button, and a modal region. I want it to work like so... A user inserts a keyword into the…
Dave Nishida
  • 77
  • 1
  • 1
  • 9