hapi-plugin-websocket icon indicating copy to clipboard operation
hapi-plugin-websocket copied to clipboard

Not accepting content type application/xml

Open anshi1694 opened this issue 6 years ago • 0 comments

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
            }
        }
    })

anshi1694 avatar Mar 15 '19 11:03 anshi1694