useEffect(() => {
function GetPostSessionData() {
let data = new FormData();
data.append("box_id", "8c457cf6-e5d3-5549-9edf-2ad999f4f870");
data.append("device_type", "83");
data.append("source", "XYZ");
const requestOptions = {
method: "POST",
body: data,
header: { "Content-Type": "multipart/form-data" },
};
fetch(
baseURl,
requestOptions
)
.then((response) => response.text())
.then((result) => console.log(result, "result >>"))
.catch((error) => console.log("error>>", error));
}
GetPostSessionData()
}, []);
response > Request is missing required form field ‘box_id’ result >>,
Am able to get correct response in Postman.
Url and other details are correct, am not sure am binding correct form data.
Suggest some Solution
I have also used axios with async await and all , it gives same response
“Request is missing required form field ‘box_id'”
New contributor
Irbaaz Hussain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.