How should I customize controllers in order to sent POST request?

For completely custom endpoint, you first need to create route. (see Routes - Strapi Developer Docs) and then point it to a your controller.

In you case, you could have something like src/api/<some name of your choice>/routes/<some name of your choise for the router>.js

With something along the lines of

module.exports = {
  routes: [
    {
      method: 'POST',
      path: '/requests', 
      handler: '<name of your controller>.<your action name>',
    },
  ]
}

And then adding a corresponding controller. See Backend customization - Controllers - Strapi Developer Docs.

Hope this helps.

1 Like