I'm sending a message via enterprise messaging in SAP from Fiori. SAPui5 code as below.
$.ajax({
type: "POST",
url: '/messagingrest/v1/topics/SeasonalityTopic/messages',
headers: {
'Access-Control-Allow-Origin': '*',
'Authorization': 'Bearer ' + accessToken, // has a value for accessToken
'Accept': '*/*',
'Cache-Control': 'no-cache',
'x-qos': '1'
},
data: "hi",
dataType: "json",
contentType: "application/x-www-form-urlencoded",
beforeSend: function (xhr) {
// xhr.setRequestHeader('Authorization', bearer);
},
success: function (ret) {
var aa = 1;
},
error: function (err) {
var aa = 2;
}
});
But this returns below message.
{ "message": "x-qos is invalid" }