http
Why HTTP protocol is designed in plain text way?
A reason that’s both technical and historical is that text protocols are almost always preferred in the Unix world. Well, this is not really a reason but a pattern. The rationale behind this is that text protocols allows you to see what’s going on on the network by just dumping everything that goes through. You … Read more
Content type for HTML fragments
In regards to XML/HTML document fragments, other than the xml-fragment referenced in the comments (now labeled as “no longer maintained”), there don’t appear to be any explicit, official references to document fragments and the content type header. However, some points to consider: The xml-fragment spec treats full documents and fragments the same in regards to … Read more
Prevent Unhandled jQuery AJAX Error [duplicate]
AFAIK you cannot make the red thingies go away, when returning error status-codes (4xx, 5xx). They are used by the browser to indicate that something might have not gone as expected. Still these are mere decorations, since 4xx and 5xx status codes are perfectly valid, so I don’t see a reason for you wanting to … Read more
Stop processing Flask route if request aborted
There is a potentially… hacky solution to your problem. Flask has the ability to stream content back to the user via a generator. The hacky part would be streaming blank data as a check to see if the connection is still open and then when your content is finished the generator could produce the actual … Read more