I have a Windows client and a Linux server on the same local network. I have simple code on client:
import requests
requests.post(url=f"http://192.168.43.227:8080/get_info/", json={"login":"some_login", "password": "some_password"})
And here server code:
from flask import Flask, request, jsonify
import threading
app = Flask(__name__)
@app.route('/get_info', methods=['GET', 'POST'])
def authorization_func():
if request.method == 'POST':
data = jsonify(request.json)
print(data)
return data
if __name__ == '__main__':
threading.Thread(target=lambda: app.run(host='localhost', port=8080, debug=True, use_reloader=False)).start()
And when I start client on Windows, it writes "Failed to establish a new connection: [WinError 10061]". What's wrong?
I hope the server would response to client