In my angular project, I am trying to create a dummy api call. I created a directory api/auth
and there is an index.php
file in it. When I try to send post data to that file using http.post
in angular, on first call it is showing 301 Moved Permanently
error. But if I try to access the url using postman, then it is working. What is wrong here?
this.http.post('/api/auth', parameters, request.options)
I have set the rest of url as base path and it will append automatically.
If I try using the url /api/auth/index.php
, then it will work without any issue.
Please help to fix this.