-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnid_check.py
30 lines (24 loc) · 872 Bytes
/
nid_check.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#python 3.7.9
import requests
from flask import Flask, render_template, request
app = Flask(__name__)
@app.route("/")
def nid():
return render_template("nid-form.html")
@app.route('/nid-data', methods = ['POST', 'GET'])
def nid_data():
if request.method == 'GET':
return f"The URL /nid-data is accessed directly. Try going to '/form' to submit form"
if request.method == 'POST':
form_data = request.form
req_data = {
# "mobile" : form_data['mobile'],
"nid" : form_data['nid'],
"dob" : form_data['dob']
}
res = requests.post('https://ldtax.gov.bd/citizen/nidCheck/', data = req_data, verify=False)
a = res.json()
data = a['data']
return render_template("nid-data.html", data = data)
if __name__ == '__main__':
app.run(debug=True)