François Richard
François Richard

Reputation: 7035

npm request GET params

I'm doing my request like that:

var options = {
        method: 'GET',
        rejectUnauthorized: false,
        url: "https://history.ripple.com/v1/accounts/r4cvz8ZLz9xBXWKkQMWpEaeEshQeG2sFxh/transactions?type=Payment&result=tesSUCCESS&limit=1000",
        headers: {
            "Content-Type": "application/json",
            "Accept": "application/json"
        }

    };
request(options, callback);

It's not working I get an error 500.

But if I set only one parameters to the url, like that: https://history.ripple.com/v1/accounts/r4cvz8ZLz9xBXWKkQMWpEaeEshQeG2sFxh/transactions?type=Payment

then is works, so I assume the problem is to set the parameters and I don't know how to do. Any clue ? Thanks a lot !

Upvotes: 1

Views: 7972

Answers (1)

François Richard
François Richard

Reputation: 7035

Ok I found the answer myself it was pretty simple.

You just have to put the query parameters in the options like that:

qs: {type: "Payment", result:"tesSUCCESS", limit:1000},

Upvotes: 15

Related Questions