Answer the question
In order to leave comments, you need to log in
The first three requests in the array disappear without a trace, hyadnt?
There is a code that pulls the API methods that make queries to the database.
Here is the code:
//сам запрос
var sendReq = function() {
return request
.get(apiUrl)
.send(prepareArrayReq()) //внутри исполняется функция которая возвращает массив запросов, 6 штук
.send(prepareArrayReq())//та же ф-я, но возвращает другой массив, 3 запроса
.end((err, res) => {
if (err || !res.ok) {
console.log('Something was wrong! ' + err);
} else {
console.log('Sucess! ' + JSON.stringify(res));
}
});
};
[ { jsonrpc: '2.0',
method: 'someMethod',
params: { one: 'one', two: 'true', three: 10},
id: '0' },
{ jsonrpc: '2.0',
method: 'someMethod',
params: { one: 'one2', two: 'true', three: 9},
id: '1' },
{ jsonrpc: '2.0',
method: 'someMethod',
params: { one: 'one3', two: 'true', three: 8},
id: '2' },
{ etc},
...
]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question