superagent Questions

3

Solved

I'm using superagent to upload files from my React Native app. It works perfectly fine on iOS, but on Android it gives this error: Possible causes: the network is offline, Origin is not allowed ...
Freud asked 5/2, 2020 at 2:23

2

I just started to learn do test with supertest and mocha. I've read the api document of supertest and it said that supertest support all lower-level API provided by superagent. SuperAgent said we c...
Halimeda asked 17/9, 2018 at 2:9

27

Every time I submit a zone, it displays this error: 'Uncaught Error: A cross-origin error was thrown. React doesn't have access to the actual error object in development' It only occurs when I pr...
Ordinand asked 4/2, 2018 at 17:59

5

Solved

I am testing an express API with supertest. I couldn't get multiple requests in a test case to work with supertest. Below is what i tried in a test case. But the test case seem to only execute the...
Farnsworth asked 13/1, 2014 at 11:12

6

Solved

I'm doing cookie session management with express with something like this: req.session.authentication = auth; And I verify the authenticated urls with something like if(!req.session.authentica...
Ashburn asked 12/8, 2012 at 4:28

5

Solved

I have a problem with uploading files from client to web api. I am getting this error "Unexpected end of MIME multipart stream. MIME multipart message is not complete." in the controller when i am ...
Allmon asked 24/8, 2016 at 13:33

5

I am trying to write a test that checks whether an API route outputs a ZIP file with the correct contents. I am using mocha and supertest for testing, and I would like to actually read the output ...
Ptosis asked 26/11, 2012 at 21:18

1

I'm testing my API with supertest I want to check that my CSRF token protection works, and then disable it for the other tests. For this I set NODE_ENV to test or not_test app.js var csrf = require...
Mchale asked 4/1, 2016 at 16:59

4

I'm making a carousel with images from Instagram using react-id-swiper. The Swiper component doesn't seem to be updating after the response. I thought that putting my setState inside componentWillM...
Festivity asked 11/6, 2018 at 20:17

4

Solved

So about a month ago I asked a question regarding superagent and sending files, but got no response at all. I would still like to find out how to do this as I enjoy using superagent. I am able to ...
Photoelasticity asked 31/7, 2015 at 14:41

1

I'm developing an API with express and testing it with supertest. My API endpoint is returning tar.gz file. I would like to test, if file is properly sent and it's content is correct. I'm having tr...
Flog asked 3/1, 2020 at 10:7

5

I am using webpack-dev-server v1.10.1 to boost up my Redux project and I have the options below: contentBase: `http://${config.HOST}:${config.PORT}`, quiet: false, noInfo: true, hot: true, inline:...
Shieh asked 24/7, 2015 at 5:16

3

Solved

I'm running a node.js server A which uses superagent to issue HTTP requests to another server B. I investigated the request on server B and saw the the header connection being close and the httpVer...
Minim asked 23/12, 2013 at 12:25

3

Solved

I am trying to make a request against a php server that is constructing the url like this: website.com/?q=help&q=moreHelp&q=evenMoreHelp How do I use superagent to pass the same query wit...
Weaverbird asked 23/6, 2014 at 17:56

4

Solved

I would like to test how an REST API handles a POST request that has a body with invalid JSON syntax, for example a missing comma. I'm using node.js to write the API tests. I'm using frisby but I a...
Refurbish asked 2/2, 2015 at 20:23

5

Solved

I'm attempting to use es6 promises with superagent. I'm attempting to call a function that has a superagent request wrapped inside. Request.post(buildReq).then(res => { if (res.ok) {//process...
Determinable asked 15/1, 2015 at 15:32

1

I am working on a side project in which I want to reuse an existing API. The API has an /auth endpoint which handles POST requests and expects the email and password in the request body. If the ema...
Factory asked 17/5, 2017 at 18:35

2

Solved

I'm writing a node app with React, using node-postgres and superagent for backend calls. Let's say I'm making a GET request and using the JSON it returns to fill a table of students. My API looks l...
Washrag asked 8/12, 2015 at 2:54

6

I am working on developing a REST API using ExpressJS, NodeJS, Mongoose and Mocha. The thing is that I have an app.coffee file, thats responsible for setting up ExpressJS and connecting to Mongoos...
Septima asked 22/9, 2013 at 8:14

2

Solved

I am learning JavaScript and I can see, in multiple big projects, SuperAgent is being used for HTTP Request. I am using Axios for learning purpose, but wondering what makes SuperAgent differe...
Lodi asked 13/8, 2018 at 3:44

1

I have a suite of tests that all pass if they are run individually. However, the tests fail due to a check on the value of a cookie if they are run in parallel. The problem is that supertest's coo...
Scudo asked 6/9, 2018 at 15:58

2

Solved

Goal is to set the variable auth correctly for further use, hence i want to refactor the function loginUser: function loginUser(user, request, auth) { return function(done) { request .post('/us...
Fianna asked 20/7, 2018 at 9:3

1

Using POSTMAN , everything is fine : I pass the same headers,params,... to superagent as following : const superagent = require('superagent'); const grab = require('ps-grab'); superagent.get(...
Lillith asked 15/10, 2016 at 20:43

4

Solved

I have an image upload endpoint in my API that accepts application/octet-stream requests and handles these streams. I'd like to write test coverage for this endpoint but cannot figure out how to us...
Yellows asked 27/3, 2018 at 10:20

1

I'm trying to build my react app into static html pages with gatsbyjs. I just tried 'gatsby build', and it goes through everything fine until it wants to create the static pages, then I get: error...
Cattish asked 25/10, 2017 at 13:56

© 2022 - 2024 — McMap. All rights reserved.