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 05 '25
I tried to put the .htaccess higher, in /cobra/ and now I got the same error, I do get any data with php://input
making all API paths virtual, i don't know how to do, i'm gonna search