Why Strapi POST Call, always expecting Multi-Part request I Don't have multi-part data in the particular content Type.
In Strapi CMS Portal, Roles & permission section, I have given access to CREATE
import React, { useState } from 'react'
export default () => {
const [description, setDescription] = useState('')
const handleSubmit = async (event) => {
event.preventDefault();
const data = await fetch('http://localhost:1337/posts', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
description
})
})
const response = await data.json();
console.log(response)
}
return (
<div className="Create">
<form onSubmit={handleSubmit}>
<input
type="text"
placeholder="Description"
value={description}
onChange={(event) => {
setDescription(event.target.value)
}}
/>
<button>Submit</button>
</form>
</div>
)
}
Technology stack which I'm using in this project
Frontend: Reactjs Backend: Strapi
When I face this issue, I may not be aware of it. What is happening in the backend(Strapi).
Thinks found after I face this issue:
api
folder, for customization purposes.POST
API call, it's working fine. Without any error.Helpful Resource, i found in strapi documentaion:
Strapi Create Customization code file in the controller file.