I am trying to create a 'pipe' between an angular frontend and a python flask backend. I have managed to communicate from the former to the latter by HttpClient.get calls but updating that to HttpClient.post breaks the communication. My code looks like:
on the Angular side:
let request = this.HttpClient.post(`http://127.0.0.1:5000/weather/loc`, { "location": this.location, }) request.subscribe((data) => { console.log(data); })
and on the flask side:
@app.route('/weather/loc', methods=["POST"])
def weather_connection():
print( request.form)
location = request.form.get("location", default="London")
#more code
The problem I see is that request.form is always ImmutableMultiDict([]) an empty dictionary. For some reason the location argument seems to have been lost somewhere.