comparison checkclient.py @ 99:349d49bb69f4

Porting on python3
author Magnus Schieder <mschieder@intevation.de>
date Tue, 19 Jun 2018 15:07:56 +0200
parents 3928af61b4ce
children
comparison
equal deleted inserted replaced
98:b2f96072b8d7 99:349d49bb69f4
24 files = {'file': open(infilename, 'rb')} 24 files = {'file': open(infilename, 'rb')}
25 25
26 r = requests.post(url, files=files) 26 r = requests.post(url, files=files)
27 27
28 if r.status_code == 200: 28 if r.status_code == 200:
29 print "OK" 29 print("OK")
30 else: 30 else:
31 print "An error has occured" 31 print("An error has occured")
32 print r.status_code, r.headers 32 print((r.status_code, r.headers))
33 print r.text 33 print((r.text))
34 sys.exit(2) 34 sys.exit(2)
35 35
36 36
37 if __name__ == "__main__": 37 if __name__ == "__main__":
38 main() 38 main()
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)