Mercurial > hg > orthanc-book
comparison Sphinx/source/users/advanced-rest.rst @ 379:c9fe3d0d0fa1
merge
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 08 Apr 2020 08:49:59 +0200 |
parents | 6d7a36447e21 |
children | 0fb9369e893e |
comparison
equal
deleted
inserted
replaced
378:16dc3561b41e | 379:c9fe3d0d0fa1 |
---|---|
185 $fileInBase64 = $([Convert]::ToBase64String((gc -Path "HelloWorld2.pdf" -Encoding Byte))) | 185 $fileInBase64 = $([Convert]::ToBase64String((gc -Path "HelloWorld2.pdf" -Encoding Byte))) |
186 | 186 |
187 # create the json data | 187 # create the json data |
188 $params = @{Tags = @{PatientName = "Benjamino";Modality = "CT"};Content= "data:application/pdf;base64,$fileInBase64"} | 188 $params = @{Tags = @{PatientName = "Benjamino";Modality = "CT"};Content= "data:application/pdf;base64,$fileInBase64"} |
189 | 189 |
190 # disabling progress bar tremendously increases the Invoke-RestMethod call | 190 # disabling the progress bar makes the Invoke-RestMethod call MUCH faster |
191 $ProgressPreference = 'SilentlyContinue' | 191 $ProgressPreference = 'SilentlyContinue' |
192 | 192 |
193 # upload it to Orthanc | 193 # upload it to Orthanc |
194 $reply = Invoke-RestMethod http://localhost:8042/tools/create-dicom -Method POST -Body ($params|ConvertTo-Json) -ContentType 'application/json' | 194 $reply = Invoke-RestMethod http://localhost:8042/tools/create-dicom -Method POST -Body ($params|ConvertTo-Json) -ContentType 'application/json' |
195 | 195 |