Each of these code examples do essentially the same thing:
STDOUTSTDERR
The cURL example does not handle errors separately, instead writing any
response to STDOUT, success or otherwise. If you plan to use cURL
in your application, make sure to check for HTTP status codes and/or
Content-Type headers. The --fail flag may be useful.
The python example uses the
Requests library. This can be
installed with pip (and we highly recommend it).