This shows you the differences between two versions of the page.
isi:laboratoare:06 [2024/11/09 21:19] alexandru.predescu [Obiective laborator] |
isi:laboratoare:06 [2024/11/11 11:43] (current) alexandru.predescu [Obiective laborator] |
||
---|---|---|---|
Line 95: | Line 95: | ||
5. Dupa finalizarea primului **TO DO** pentru testare descarcati postman de [[https://www.postman.com/downloads/|aici]]. | 5. Dupa finalizarea primului **TO DO** pentru testare descarcati postman de [[https://www.postman.com/downloads/|aici]]. | ||
+ | |||
+ | <note tip> | ||
+ | |||
+ | De obicei, cererile de tip GET nu conțin date în body și se parametrizează astfel: | ||
+ | |||
+ | Exemplu cereri GET cu parametru în URL: | ||
+ | |||
+ | ''http://localhost:5000/login?username=alex&password=1234'' | ||
+ | |||
+ | <code python> | ||
+ | @app.route('/login', methods=['GET']) | ||
+ | def login(): | ||
+ | username = request.args.get('username') | ||
+ | print(username) | ||
+ | password = request.args.get('password') | ||
+ | print(password) | ||
+ | return jsonify({"status": True}) | ||
+ | </code> | ||
+ | |||
+ | </note> | ||
=== Task === | === Task === |