[How to Fix] NameError: name ‘requests‘ is not defined & NameError: name ‘request‘ is not defined

NameError: name ‘requests‘ is not defined is lack of package import requests;
NameError: name ‘request’ is not defined because of lack of package from flask import request.
these two look too much alike, but they don’t work the same way. “Requests” is for getting GET, POST requests, etc., such as

 r = requests.get('https://api.github.com/user', auth=('user', 'pass'))

“request” is used to get form data such as

request.form.get("value")

, or the front-end request method, etc. For more details, please refer to request

in flask

reference:
Requests: let HTTP service humans
NameError: name ‘request’ is not defined


Read More: