Chrome is automatically sending get request without any affect on page | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Chrome is automatically sending get request without any affect on page

I wrote a program using Python Flask by which I can upload, download and delete files from server. But whenever I open it in chrome It is automatically sending get request to specific url. This url is used to delete file. URL looks like this : http://127.0.0.1/delete/filename Chrome is only sending get request to this url if it has ".mp4" file extension. But page is not even refreshing or changing. But mine app is working fine in FireFox HELP! This is very weird. This is source code:: https://github.com/ShailMurtaza/Upload-Download-Files-FlaskApp

31st Oct 2020, 1:27 PM
🌀 Shail Murtaza شعیل مرتضیٰ
🌀 Shail Murtaza شعیل مرتضیٰ - avatar
2 Answers
0
You are trying to say that your JavaScript front end only sends GET requests in Chrome? If that's the case, what library/API are you using? If that is not the case I guess the problem is that you misunderstood why the browser sends a GET request: the browser sends a GET request to whatever is in the URL bar, the expected response is an HTML file and all the assets (CSS, JavaScript, images, fonts, etc). Something else I want to say is that you can have a single route that supports multiple "protocols" (GET, POST, DELETE, etc). For testing your API you should use a Rest client like Postman or Insomnia. I personally prefer Insomnia but both are more than enough for most cases.
2nd Nov 2020, 10:38 PM
Martín Stanicio
0
Martín Stanicio There is button in mine webpage. Every file has its own delete button. When I will press this delete button correspondence file will delete from server. This delete button send a get request which contains filename. But problem is that, chrome is sending get request without pressing delete button and mine files are deleting automatically. This happened only with mp4 files
4th Nov 2020, 4:58 AM
🌀 Shail Murtaza شعیل مرتضیٰ
🌀 Shail Murtaza شعیل مرتضیٰ - avatar