Posting data to an endpoint which is working fine when I select raw
and send json.
I am not receiving anything when I select form-data
. I have already defined them in my server.js
.
server.js config:
const express = require("express");
const bodyParser = require("body-parser");
const cors = require("cors");
const app = express();
var corsOptions = {
origin: "http://localhost:8081"
};
app.use(cors(corsOptions));
app.use(express.static('app/uploaded'));
// parse requests of content-type - application/json
app.use(bodyParser.json());
// parse requests of content-type - application/x-www-form-urlencoded
app.use(bodyParser.urlencoded({ extended: true }));
Here is the postman request.