Do I have to declare data in axios config Do I have to declare data in axios config mongoose mongoose

Do I have to declare data in axios config


I think you should not send a body in DELETE. You should use it like GET, and pass parameters in the URL.

Read: Axios API, DELETE body

Request method aliases:

axios.post(url[, data[, config]])axios.delete(url[, config])

Request Config:

{...  // `data` is the data to be sent as the request body  // Only applicable for request methods 'PUT', 'POST', and 'PATCH'  // When no `transformRequest` is set, must be of one of the following types:  // - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams  // - Browser only: FormData, File, Blob  // - Node only: Stream, Buffer  data: {    firstName: 'Fred'  },...}