-2

Not sure if anyone else has experienced this, but for some reason when making requests (get/post) I'm seeing duplicate requests in the network tab of Chrome developer tools, and my server is clearly getting hit twice. I added in the middleware for image uploads found in admin-on-rests documentation but I only see that called once by adding logging. Has anyone else dealt with this issue?

Keith V
  • 680
  • 4
  • 13
  • Can you post a screenshot of the network tab showing some duplicate requests ? With method column enabled please – Gildas Garcia Nov 22 '17 at 16:09
  • Too sketchy a question. Please give more details, such as component that is doing this. The code, the API server, the restClient used etc. – kunal pareek Nov 23 '17 at 08:23

1 Answers1

0

It may depend on used backend. You did not provide any info about these requests.

For example if backend protected and demand some kind of special authentication - fronted will be sending OPTIONS requests before POST, PUT etc
In trace log these requests may looks the same - but first will be OPTIONS request and second POST.

OPTIONS request in HTTP means that fronted 'asks' server - 'may I put that data to that url by POST? I have authentication token etc' :) And if server answer - okay - you may do that. Frontend will send POST request.


By other scenario - that may be because backend routing configuration.
Frontend may send GET request for example to endpoint http://1/1
Backend respond by 301 error - with information that this endpoint located by different url - for example http/1/1/ (added '/' and the end - that may be frequently confronted wille working with django)
And Frontend send another request to http://1/1/

Muritiku
  • 222
  • 1
  • 7