comparison Sphinx/source/users/rest.rst @ 674:5ec581c7e610

Warning about using cURL from the Windows prompt
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 06 May 2021 14:52:56 +0200
parents bc8fa2bf4cf7
children aba6dac03d16
comparison
equal deleted inserted replaced
673:767c2550fa00 674:5ec581c7e610
21 21
22 *Note:* All the examples are illustrated with the `cURL command-line 22 *Note:* All the examples are illustrated with the `cURL command-line
23 tool <https://curl.haxx.se/>`__, but equivalent calls can be readily 23 tool <https://curl.haxx.se/>`__, but equivalent calls can be readily
24 transposed to any programming language that supports both HTTP and 24 transposed to any programming language that supports both HTTP and
25 JSON. 25 JSON.
26
27
28 .. _curl-windows:
29
30 Warning about using cURL from the Windows prompt
31 ------------------------------------------------
32
33 The examples on this page assume that the user is running a bash shell
34 on some GNU/Linux distribution. Such a shell has the major advantage
35 of having the possibility to use either single-quote or double-quotes
36 characters in order to group a set of characters (including spaces) as
37 a whole string.
38
39 .. highlight:: bash
40
41 Unfortunately, the default command-line prompt of Microsoft Windows
42 **doesn't support single-quote characters**. If you execute a cURL
43 command-line from this page that mixes single-quote and double-quotes,
44 you'll have to replace single-quotes by double-quotes, and prefix the
45 double-quotes by a backslash character. For instance, consider the
46 following command line that works fine on GNU/Linux::
47
48 $ curl -v -X PUT http://localhost:8042/modalities/sample \
49 -d '{"AET" : "ORTHANCC", "Host": "127.0.0.1", "Port": 2002}'
50
51 This call will **not** work on the Microsoft Windows prompt as it
52 contains single-quotes. You should adapt this command line as follows
53 to run it on Windows::
54
55 $ curl -v -X PUT http://localhost:8042/modalities/sample \
56 -d "{\"AET\" : \"ORTHANCC\", \"Host\": \"127.0.0.1\", \"Port\": 2002}"
57
58 As an alternative, consider using a different Windows shell, for
59 instance `Windows PowerShell
60 <https://fr.wikipedia.org/wiki/Windows_PowerShell>`__ (some examples
61 of PowerShell can be found below on this page).
26 62
27 63
28 .. _sending-dicom-images: 64 .. _sending-dicom-images:
29 65
30 Sending DICOM images 66 Sending DICOM images