Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Nicolai Kamenzky
    @analog-nico
    @a-eid Sorry, I missed your message. Have a look at the cookie example. You can set multiple cookies there.
    Stephen James
    @sjames1958gm
    @analog-nico thx
    KernelDev
    @KernelDev
    Hi, is there an option to set a timeout on the request? Also could you provide a response time with the response object?
    Nicolai Kamenzky
    @analog-nico
    @KernelDev Have a look at the Request options. Request-Promise is built on top of Request and you can use all its options with Request-Promise as well. There is a timeout option. For the response time you can build a wrapper around your requests.
    KernelDev
    @KernelDev
    @analog-nico Thank you very much
    Pulkit Singhal
    @pulkitsinghal
    Where can I find release notes for each release? One of my modules is using a really old version 0.3.2 of request-promise and I'm seeing some issues where the request hangs indefinitely after a POST ... so I want to go through each version's release notes and find out which one might have fixed this issue or incorporated an update of request to fix such symptoms
    John Doe
    @peculiarity
    Hey guys
    I have
    import request from 'request-promise-native';
    creating a UMD module
    in the browser everything works fine
    when I get to NODE repl and inject my dist file
    TypeError: global.XMLHttpRequest is not a constructor
    This happens when I require my bundle ( using webpack)
    any ideas?
    John Doe
    @peculiarity
    ok I fixed that issue .. got new one ..
    andreas
    @andreasvirkus
    Hi all. I'm having issues setting my content-type header for a request containing files.
    .then(token => {
        return rest.post({
            uri: '/api/v1/upload',
            headers: {
                'Authorization': token,
                'content-type': 'multipart/mixed',
            },
            formData: formData
        });
    })
    the request still shows the value multipart/form-data
    am I setting the header wrong somehow?
    John Doe
    @peculiarity
    oook :)
    what do you want to upload ?
    Nicolai Kamenzky
    @analog-nico
    @pulkitsinghal Hey old pal, how are you doing? Have a look at the README. At the bottom there are all changes with the breaking changes being marked. At the top there are even migration steps you might need to take.
    Nicolai Kamenzky
    @analog-nico
    @andreasvirkus Have a look at the details about forms in the request README. Btw, all request options work for request-promise as well. Usually, you don’t have to set the header yourself. It’s set automatically when you e.g. use the formData option.
    Pulkit Singhal
    @pulkitsinghal
    @analog-nico - you're right! i got distracted with the notes on top and didn't scroll down far enough to see the details at the bottom. Thanks for pointing that out!!!
    andreas
    @andreasvirkus
    The curl equivalent of what I'm trying to accomplish is this:
    curl -X POST http://localhost:8080/api/v1/upload -H “authorization:here goes token"
      --header "Content-type: multipart/mixed"  -F "imageFile=@TestImage.jpg”
      -F "imageFile=@TestImage2.jpg" -F "applicationNumber=SL-ESA-17000322"   -F "personalId=12345678A"
    @analog-nico I can't use multipart/form-data unfortunately : /
    andreas
    @andreasvirkus

    If I try and send my images as base64:

    const formData = {
        applicationNumber,
        personalId,
        imageFile: files.map(file => new Buffer(fs.readFileSync(file.path)).toString('base64')),
    };

    then I get an error write after end

    andreas
    @andreasvirkus
    Correction, the error I get is about the request being sent with contentType multipart/form-data:
    415 - "{\"timestamp\":1506930784462,\"status\":415,\"error\":
    \"Unsupported Media Type\",\"exception\":\"org.springframework.web.HttpMediaTypeNotSupportedException\",
    \"message\":\"Content type 'multipart/form-data;boundary=--------------------------732586446978103238773917' not supported\",
    \"path\":\"/api/v1/upload\"}"
    any help greatly appreciated!
    andreas
    @andreasvirkus
    Any help?
    andreas
    @andreasvirkus
    For any future lurkers, I figured it out. Ended up with this code:
    const formData = {
        applicationNumber,
        personalId,
    };
    
    const multipart = files.map(file => ({
        'content-type': 'multipart/mixed',
        body: fs.createReadStream(file.path),
    }));
    
    return rest.post({
        postambleCRLF: true,
        uri: Configuration.getIdentificationServiceUrl() + '/api/v1/upload',
        headers: {
            'Content-type': 'multipart/mixed',
            'Authorization': token,
        },
        multipart,
        qs: formData,
    });
    johnathandinh
    @johnathandinh
    Hello!
    Has anyone heard of issues of promises losing their way when a request is sent to a proxy
    manapausejp
    @manapausejp
    Hi all, I'm looking to use request-promise to send multiple messages to facebook (https://graph.facebook.com/v2.6/me/messages) in sequence. Could someone help out - although having read-up on simple promises, I'm not sure about chaining and catching errors.
    Velin Georgiev
    @VelinGeorgiev
    Hi all, does request-promise-native support sending requests behind corporate proxy?
    Dan Stein
    @happy-machine
    Hey, im getting unhandled rejection errors from request-promise
    but as far as im aware my .then chain is correct
    charlie kurban
    @charliekurban_twitter

    Hi

    I have request promise version 2.83.0
    When I make a api call to the backend via request-promise then I am getting below written timeout error BUT when I make same call via POSTMAN then it works fine. Seems to be error is down to the request-promise.

    { RequestError: Error: connect ETIMEDOUT 54.229.253.90:443
    at new RequestError (/Users/xxx/dev/yyyy/node_modules/request-promise-core/lib/errors.js:14:15)
    at Request.plumbing.callback (/Users/xxx/dev/yyyy/node_modules/request-promise-core/lib/plumbing.js:87:29)
    at Request.RP$callback [as _callback] (/Users/xxx/dev/yyyy/node_modules/request-promise-core/lib/plumbing.js:46:31)
    at self.callback (/Users/xxx/dev/yyyy/node_modules/request/request.js:186:22)
    at Request.emit (events.js:127:13)
    at Request.emit (domain.js:421:20)
    at Request.onRequestError (/Users/xxx/dev/yyyy/node_modules/request/request.js:878:8)
    at ClientRequest.emit (events.js:132:15)
    at ClientRequest.emit (domain.js:421:20)
    at TLSSocket.socketErrorListener (_http_client.js:394:9)
    at TLSSocket.emit (events.js:127:13)
    at TLSSocket.emit (domain.js:421:20)
    at emitErrorNT (internal/streams/destroy.js:64:8)
    at process._tickCallback (internal/process/next_tick.js:114:19)
    duizabojul
    @duizabojul
    Hi, I want to use request-promise for fetching prices from a supplier site. My main concern is i need to log in before accessing all the prices
    So i have to maintain session after the login
    I tried to include cookies in each request with let j = request.jar()then adding jar : jin options of each request but it apparently doesn't works... Anyone has an idea of how to achieve that?
    Pritam
    @pritamsarkar007
    what option I need to set for CA validation?
    for request-promise-native
    klyn12
    @klyn12
    I'm using request-promise with a bearer token. I get back a "StatusCodeError: 404 - undefined" error. The same uri I'm using works in Postman. Do any of you know why I'm getting a 404 error?
    Daniel Payne
    @dpayne_ytel_gitlab
    hey
    im having a mem leak with the new tough cookie filling up the heap
    4.2.2
    kaleabmelese
    @kaleabmelese
    (node:19286) UnhandledPromiseRejectionWarning: StatusCodeError: 400 - {"error":{"message":"INVALID_PARAMETERS"}}
    .. I am having this error on my terminal while tryin to get a request and i have handled the promise well i think.. here it is.... createInvoices: (whose, payload) => {
    return new Promise((resolve, reject) => {
    self.login(whose)
    .then(token => {
    var options = {
    url: config.api.invoices,
    method: "POST",
    json: true,
    headers: {
    authorization: Bearer ${token}
    },
    body: payload
    }
    rp(options).then(crtdinvoice => {
    console.log(crtdinvoice);
    // resolve(data)
                    })
                }) .catch(err => {
                    reject(err)
                })
    
        })
    }
    Nicolai Kamenzky
    @analog-nico
    I think you are missing the catch for the promise returned by self.login(...)
    Lucas Kohorst
    @Lucas-Kohorst

    Hi guys I am working on using react and corenlp for a project. corenlp depends on request-promise-native. When I start my react app I get an error ./node_modules/corenlp/dist/connector/connector-serer.js Module not found: Can't resolve 'request-promise-native'

    Even though I have request-promise-native in my package.json