Stuck in File upload issue in Hapi (version -19.0.5) along with json data

Viewed 42

I am using "@hapi/hapi": "^19.0.5". My routes are

    server.route({
        handler: async (req, h) => {
            console.log(req.payload);
            return h.response("req.payload");
        },
        method: "POST",
        options: {
            payload: {
                output: "stream",
                parse: true
            },
        },
        path: `/api/feed/upload`,
    });

    server.route({
        handler: (request, h) => {
            const payload = request.payload;
            console.log(payload);
            return "I have a stream";
        },
        method: "POST",
        options: {
            auth: false,
            payload: {
                output: "stream",
                parse: true
            }
        },
        path: `/api/feed/upload-stream`,
    });

My Postman Request is :

enter image description here

From inside Header: "Content-Type: multipart/form-data" is sent. I am using typescript(3.5.2), Hapi(@hapi/hapi": "^19.0.5). always getting 415.

0 Answers
Related