hapi-plugin-websocket
hapi-plugin-websocket copied to clipboard
Not accepting content type application/xml
Working fine for content type application/json, but when passing application/xml giving following error: {"statusCode":415,"error":"Unsupported Media Type","message":"Unsupported Media Type"}
Code used:
server.route({
method: "POST",
path: "/bar",
config: {
auth:false,
payload: {
output: "data",
parse: false,
allow: "application/xml"
},
plugins: {
websocket: true
}
},
handler: (request, h) => {
let {
mode
} = request.websocket()
console.log(request.payload)
return {
at: "bar",
mode: mode,
seen: request.payload
}
}
})