how to get ip of client get request in python code example
Example 1: get request python
import requests
x = requests.get('https://w3schools.com')
print(x.status_code)
Example 2: flask get ip of user
from flask import request
from flask import jsonify
@app.route("/get_my_ip", methods=["GET"])
def get_my_ip():
return jsonify({'ip': request.remote_addr}), 200