as shown below in the code,i have a webservice stashVector with POSTmethod. from angular i post the data shown in code section below.
i would like to know how can i access the contents or the data posted to the webservice in python. for example, the object params contains the follwoing key-values:
let params = {
"ID":this.ID,
"threshold":this.threshold,
"visOpD":this.visOpD
}
how can i access the these keys and values from python code.
post in Angular
public startStashVector(params) {
var endpointURL = this.buildEndpointURLForStashVectorForLocalHost();
return this.httpClient.post(endpointURL,{
method:'POST',
body:JSON.stringify(params)
})
.subscribe((response)=>{
console.log("WebServiceForStashVectorLocalHostResponse: ", response);
this.eventEmitterResponseForStashVector.emit(response);
});
}
webservice in python
@app.route("/stashVector/", methods=['POST','OPTIONS'])
def stashVector():
preFlight = FlaskAccessControlUtils.preFlightCheck(request)
if preFlight: return preFlight
print("selectedID: %s",request.args.get("body",""))
print("request.args: %s",request.form.getlist('name[]'))
exit()