jeudi 20 septembre 2018

Axios GET requests with different parameters are discarded

I've got a React application launching GET requests using Axios. For some reason, when there are requests with different parameters, only the requests with one type of parameters are coursed with any trace in the chrome dev tools. I've checked both console and network tab and there are no request.

The application shows a map where I load data by tile, so my requests look like this:

http://SERVER_IP:1002/data/tile/6/15/39?param1=8&param2=paramValue1
http://SERVER_IP:1002/data/tile/6/15/40?param1=8&param2=paramValue1
http://SERVER_IP:1002/data/tile/6/15/41?param1=8&param2=paramValue1

http://SERVER_IP:1002/data/tile/6/15/39?param1=8&param2=paramValue2
http://SERVER_IP:1002/data/tile/6/15/40?param1=8&param2=paramValue2
http://SERVER_IP:1002/data/tile/6/15/41?param1=8&param2=paramValue2

This is my code:

return axios.get(
    serviceURL,
    {
      cancelToken: source.token,
      timeout: 20000,
      params: {
        param1,
        param2,
      },
    })
    .then(resolveRequest())
    .catch(handleErrors());

When the app launch requests with paramValue1 or paramValue2, they are coursed properly but when I have requests with both param values paramValue1 requests are not course without leaving any trace. Any ideas?

Note 1: My serving layer currently uses HTTP/1.1.

Note 2: For those not familiarized with tiles is just a way to divide a map in square regions making easy to load data by chunks.




Aucun commentaire:

Enregistrer un commentaire