r/PHPhelp • u/Double-Bed313 • Sep 04 '25
problem file_get_contents("php://input", true) that does not read any data if / does not end url
Hello,
I created an api rest and i manage to retrieve data with
file_get_contents("php://input", true)
If I call the api with postman with / at the end of url it works well.
But if I do not put the / at the end of the url, file_get_contents("php://input", true) does not get any data.
Does anyone know how I could solve this problem ?
Many many thanks in advance.
4
Upvotes
View all comments
Show parent comment
1
u/Double-Bed313 Sep 09 '25
I finally made it with a syntax of htaccess I found on internet.
in the directory IN I wrote this htaccess and i removed the login directory and payments directory. I created a page called login.php and payments.php in the directory IN.
Now, with / as no / it works !!!!!!!!!!!
Thank you very much for your help and thank you to all who participated in this thread.