If I try to receive a POST request with a body that is serialized with MessagePack (instead of JSON) I get an API error saying that it is not valid JSON. Is there any way to make Strapi work with MessagePack?
BTW encoding outgoing traffic with MessagePack was easy
/src/middlewares/messagepack.js
const msgpackr = require('msgpackr');
module.exports = () => {
return async (ctx, next) => {
await next();
// Serialize
ctx.response.body = msgpackr.pack(ctx.response.body);
};
};
/src/api//routes/01-my-route.js
module.exports = {
routes: [
{
method: 'GET',
path: '/blabla',
handler: 'score.getBlaBla',
config: {
middlewares: ['global::messagepack'],
},
},
]
}