I hope you're good.
I'm working on an inventory system and I'm using FlightPHP to create the REST because is very light and i used to work in another projects before.
But right now, I have a trouble with that framework and I tried to find a possible solution for that issue but I couldn't.
First of all, I'll paste part of the code that I'm using
Flight::route('PUT /proveedores/', function() {
$put_request = Flight::request();
$Proveedor = new Proveedor(
$put_request->data->RazonSocial,
$put_request->data->RFC,
$put_request->data->Domicilio,
$put_request->data->Numero,
$put_request->data->Colonia,
$put_request->data->Municipio,
$put_request->data->Estado,
$put_request->data->Pais,
$put_request->data->CodigoPostal,
$put_request->data->CondicionPago,
$put_request->data->Plazo,
$put_request->data->CorreoElectronico,
$put_request->data->Contrarrecibos,
$put_request->data->Observaciones
);
$Proveedor->setID($put_request->data->IDProveedor);
$Updated = ProveedoresController::updateProveedor($Proveedor);
if($Updated) {
Flight::halt(200);
} else {
Flight::halt(500);
}
});
As you can see, the code is easy to understand. I have a PUT method working within a /proveedores/ path and after that, I'm getting the request to read each field of the HTTP packet (I don't want to specify the code below because I tested it and the issue is not in that section).
The trouble is when I'm getting the data from the Flight::request method, I'm getting NULL values. I tested it with POSTMAN and with my application and I still having that issue. I don't know what is happening, because with the another methods I'm using (such as GET, POST and DELETE) are working properly.
P.D. Sorry if my english is bad, I hope you'll understand my situation and help me with that trouble