Uploading the Dicoms
import requests
from requests_toolbelt.multipart.encoder import MultipartEncoder
file_paths = ['dicom-file1.dcm', 'dicom-file2.dcm']
m = MultipartEncoder({
file_path: (file_path, open(file_path, 'rb'), 'application/dicom')
for file_path in file_paths
})
content_type = 'multipart/related; type=application/dicom; boundary={}'\
.format(m.boundary_value)
# Make the HTTP POST request to the service
r = requests.post(
url=URL, data=m,
headers={'Content-Type': content_type,
'Authorization': 'Token {}'.format(TOKEN)})Uploading Dicoms to the Service
Path Parameters
Name
Type
Description
Headers
Name
Type
Description
Request Body
Name
Type
Description
Response Attribute
Attribute
Value type
Description
Sample Value
Last updated