Questions tagged [superagent]
410 questions
-1
votes
1 answer
How to make https calls using SuperAgent?
I am using SuperAgent in React Native Android which is similar to Node.js environment. I am trying to call my API using https protocol. However, by simply calling
Req = SuperAgent
.get(‘https://url...')
…

ZJL
- 247
- 5
- 16
-1
votes
1 answer
NodeJS/Passport - Testing user login with mocha and superagent
I have built a login process with a basic MEAN stack and using passport for the authentication process.
I am trying to set up a test to make sure the login process is working. To do the login part here is the code I used:
it ('login',…

Spearfisher
- 8,445
- 19
- 70
- 124
-2
votes
1 answer
Request blocked by CORS policy using superagent and a Lumen API
I have create a REST API using PHP Lumen framework to which I removed all CORS restriction for development using:
// Enable CORS on all API routes
header('Access-Control-Allow-Origin: *');
header("Access-Control-Expose-Headers: Content-Length,…

johannchopin
- 13,720
- 10
- 55
- 101
-2
votes
1 answer
How to wait for all superagent calls to complete before reaching the end of the function
I am trying to make multiple api calls which are dynamically created from some input, the issue is that the method ends prior to the completion of all Ajax calls. I need to trigger an additional function to use the resulting json values from the Api…

PhantomThor
- 13
- 4
-2
votes
1 answer
Dynamically testing authentication RESTful API (NodeJS, Mocha, SuperAgent)
Goal:
I am trying to test my authentication RESTful API. The tools i am using are NodeJS with the modules: Mocha, Supertest(.agent) and chai(.assert).
What i tried:
var users = [ new User("admin", "secretPass"), new User("guest",…

Jeroen Bos
- 87
- 9