1

I'm using WordPress API and testing my routes with Insomnia software.

Everything works good with my GET routes but not with my POST routes.

I have 2 POST routes: one to register and one to log in. I also use JWT token.

Here is my POST route to log in :

http://localhost/Barbieshop/jwt-auth/v1/token

Setting login route

Auth : no authentication

I get an 404 Not Found answer

Here is my Register route : http://localhost/Barbieshop/wp-json/wp/v2/users/register Setting for Register route

Here is my .htacess file information :

>RewriteCond %{REQUEST_URI} !^wp/
>RewriteCond %{REQUEST_FILENAME} !-f
>RewriteCond %{REQUEST_FILENAME} !-d
>RewriteRule ^(.*)$ index.php/$1
>#Plugin JWT auth
>RewriteEngine on
>RewriteCond %{HTTP:Authorization} ^(.*)
>RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]

Thanks for your help !

Rolek
  • 73
  • 6

1 Answers1

0

You need to specify the port, for example, http://localhost:5000/

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 17 '22 at 20:11
  • @Hugo, not necessarily, just localhost refers to the default 80 port – Demian Nov 18 '22 at 15:58