Skip to content
Advertisement

laravel 7 keeps adding ‘/public/’ to my api routes

I am trying to make a php curl request to my laravel api

Here’s the curl function

JavaScript

Here’s where I call it :

JavaScript

Here’s the result :

JavaScript

Looks like laravel doesn’t get that it’s an api request and keeps changing the url to https://api.adjeminpay.net/ public/ v1/auth/getToken/ ; it also tries to redirect to https://api.adjeminpay.net/

Help kudasai TT

Advertisement

Answer

Sooo, turns out the syntax/version of curl I was using was defective/uncomplete.

Went over to PostMan and executed the same request then copipasted the php -curl code which looks like this :

JavaScript

And it works fine now. Arigathanks (^^)/

By the way How to generate PHP -curl code from POSTMAN.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement