# HG changeset patch # User Alain Mazy # Date 1745498439 -7200 # Node ID 730fd5c08b0bb8a174b336eaef05f20a80b16e3d # Parent ebc0c3323c9874872cd09d2ff96ce9fc8b37594c python streaming diff -r ebc0c3323c98 -r 730fd5c08b0b Sphinx/source/faq/how-do-you-spell-orthanc.rst --- a/Sphinx/source/faq/how-do-you-spell-orthanc.rst Mon Apr 14 08:57:19 2025 +0200 +++ b/Sphinx/source/faq/how-do-you-spell-orthanc.rst Thu Apr 24 14:40:39 2025 +0200 @@ -14,6 +14,7 @@ - ORTHAC - ORTHAN - ORTHANK +- ORTHANS - ORTHNAC - ORTHONC - ORTNAC diff -r ebc0c3323c98 -r 730fd5c08b0b Sphinx/source/plugins/python/extend-api-with-streaming.py --- a/Sphinx/source/plugins/python/extend-api-with-streaming.py Mon Apr 14 08:57:19 2025 +0200 +++ b/Sphinx/source/plugins/python/extend-api-with-streaming.py Thu Apr 24 14:40:39 2025 +0200 @@ -10,6 +10,9 @@ # put your business logic here with requests.get(f"http://localhost:8043/studies/{study_id}/archive", headers = { 'Authorization' : TOKEN }, stream = True) as r: + # Note, it is important to set the headers before calling StartStreamAnswer, once the answer has started to stream, it is to late to modify headers + output.SetHttpHeader('Content-Disposition', 'filename=my-custom-name.zip') + output.StartStreamAnswer('application/zip') for buffer in r.iter_content(16*1024, False):