I have an answer that can return text/htmlor application/octet-stream. If I get html, I would like to replace part of the page with the response data returned, and if I get binary data (file download), I would like to display a message and send the data to the browser so that the user can download the file. Is there any way to do this?
text/html
application/octet-stream
The only thing I can think of is to make your loading scene two-legged. That is, first ask what type of response will be executed with the request data, and then execute the actual request and process both situations accordingly.
Source: https://habr.com/ru/post/1747558/More articles:How do you access configuration outside of a request in CherryPy? - pythonchecking for special characters - ruby | fooobar.comHow to determine the last character - javaCan I request a DOM document with xpath expression from multiple threads safely? - javaJSP Upload and Download Videos - uploadCreating a div is fixed vertically, but glued to the page border horizontally - htmlHow can I implement appengine data warehouse models? - pythonCan you set the value of a form field in PHP? - phpAre tips on tuning the usus invalide database performance for a third-party application like Drupal - mysqlstring in JsonObject in C # - jsonAll Articles