YoungC0DE/API-Products

API with php vanilla returns data null

Closed this issue · 1 comments

I created an API with php vanilla, and when I try to make a request with the GET method,
passing a json data the data is null in the API getting with file_get_contents('php://input')

In a test with insomnia I can see the values arriving in the API but in my frontend project consuming the API the data values are null when they arrive in the API

Why does it happen?

I solved this by passing the values in the URL with params, so I can get everything without problems