Как получить и распечатать данные, которые были отправлены nodeJS в python?
Я использую ExpressJS в этом nodeJs Модуль
app.use("/py/sendomodel", function (req, res, next) {
var oData = {
"Test":"FirstData"
}
var options = {
method: 'POST',
data : oData,
url: 'https://xxx.cfapps.us10.hana.ondemand.com/mprs/omodel',
headers: {
'cache-control': 'no-cache',
/*'Content-Type' :'application/json',*/
Connection: 'keep-alive',
'accept-encoding': 'gzip, deflate',
Host: 'xxxx.cfapps.us10.hana.ondemand.com',
'Cache-Control': 'no-cache',
Accept: '*/*',
'User-Agent': 'PostmanRuntime/7.15.0'
}
};
return request(options, function (error, response,body,data) {
if (error) throw new Error(error);
});
});
Теперь я застрял здесь, как распечатать отправленные данные? Вот python Модуль
from bottle import route, run, post, request, response
@route('/mprs/omodel', method='POST')
def profile():
#I tried all these without any success , I want to print the oData that I have sent via nodeJs
#request.body.read().decode('utf8')
temp = request.body.read()
#temp = request.json
#sol = request.forms
print(temp)
#jsonData = json.load(request.body)
#return jsonData
return(temp)