-1

As the answer and comment in https://stackoverflow.com/a/31764155/10189759
suggest that everything could be done using a curl could be done using python request.

My question is how to pass option like -u -i to the request function?

For example in this tutorial github api

curl -i -u your_username:your_token https://api.github.com/user

How could I use request to pass my args and option to the url?

Luk Aron
  • 1,235
  • 11
  • 34

1 Answers1

1

You can do it like this:

import requests

response = requests.get('https://api.github.com/user', auth=('your_username', 'your_token'))
Mate Ajdukovic
  • 340
  • 3
  • 17