1

I was running curl command from unix shell for adding the users in ranger (hadoop) but I want to run the same curl command from python script, How to achieve the same ? Please find below curl command for the same : curl -u admin:admin -v -X POST -H "Accept: application/json" -H "Content-Type: application/json" http://:6080/service/xusers/secure/users -d @/tmp/userfile.json

Jay
  • 296
  • 10
  • 25
  • How to provide credentials like here I am providing admin:admin with curl ? – Jay Jul 05 '18 at 10:03
  • Note that calling the curl command external to your python script may not be the best design. If you want to use the request api provided by Python language then see here instead: https://stackoverflow.com/questions/22567306/python-requests-file-upload – Andrew Khoury Aug 19 '19 at 21:19

0 Answers0