Joao 0 Posted February 8, 2021 Hi, I´m trying to import and use "resquests" from python on delphi. Already did a bit of the path, but can´t use get in the righ way; on Python i´m using : import requests def test(): response = requests.get('http://192.168.1.200/gci-bin/users', auth=requests.HTTPDigestAuth('admin','admin'), stream=True, timeout=60) print(response.text) on Delphi i´m trying to import requests and use it on my code: var request, response: TVariant; begin request := import('requests'); response := request.get('URL STRING'); //<<-- here i need to insert the args used on python call such as auth=request.auth.HTTPDigestAuth('user','pass'), stream=True, timeout=60 showmessage(response.text); end; how can i use the functions and methods with args on delphi ? Share this post Link to post
pyscripter 689 Posted February 9, 2021 P4D supports named parameters as follows: requests.get('http://192.168.1.200/gci-bin/users', auth:=requests.HTTPDigestAuth('admin','admin') Please note the := notation. Share this post Link to post