Unsupported Media Type
gacou54 opened this issue · 1 comments
I don't really understand the error I got, maybe you can help me. I didn't have any problem with the library when installing it on my "general" environment (Anaconda, Python 3.7), but when I install dicomweb_client
on a new virtual environment (python 3.7, with dicomweb_client installed only), I get the error below when using this: client.store_instances(datasets=[ds])
HTTPError: 415 Client Error: Unsupported Media Type for URL: http://localhost:8000/studies
I investigated a little with tcpdump
in order to capture the requests. With the general environment, where I didn't have an error, here is the captured request :
h#..h#..POST /studies HTTP/1.1
User-Agent: python-requests/2.22.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Host: localhost
Content-Type: multipart/related; type="application/dicom"; boundary=0f3cf5c0-70e0-41ef-baef-c6f9f65ec3e1
Content-Length: 525907
It seems to me as expected. Then, with my new virtual environment with only dicomweb_client (python 3.7), and with the exact same command, here is what I got:
h#~.h#~.POST /studies HTTP/1.1
User-Agent: python-requests/2.23.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Host: localhost
Content-Length: 119
Content-Type: application/x-www-form-urlencoded
An I missing something or this is not the expected behavior?
Thank you very much,
Gabriel
Thanks @gacou54 for reporting the issue. This should be fixed with release 0.40.1.
The latest version is available on pypi (https://pypi.org/project/dicomweb-client/0.40.1)