I want to send a post request with the body in Axios. here is the function I wrote and here the API will work if it only has a header. But in the case for APIs that need a body, it's not working. (Error since API body is not properly received in the server.). Is this the proper way to do this.
const post = (endPoint = '', header = {}, body = {}) => {
return axios({method: 'POST', url: `${urls.apiBaseUrl}/${endPoint}/?tenant_id=3`, headers: header, body: body})
}