i have 2 web systems on development,system A and system B.in system A upon creating a product its stored in the products table and at the same time pushed to a same products table in system B.i am using GuzzleHttpClient() connect to api that posts the data to the system b.on die dump am getting the data that i have created in an array but the problem is the data isnt being pushed to the api that posts the data.instead am getting an error Server error: POST http://systemb/api/push_products resulted in a 500 Internal Server Error response:..i have understood where the error is coming from.the url is being read in the http client but the data isnt being pushed.
here is my function that creates the data
$product_details=new Product;
$product_details->product_title=$request->product_title;
$product_details->product_details=$request->product_details;
$product_details->save();
// http client request to push data to systemb
$client = new \GuzzleHttp\Client();
$url = "http://systemb/api/push_products";
$input = $request->all();
//Post to server
$response = $client->request('POST',$url,[
$input
]);
on die dump the $input i get an array of all the product details have created.
this is my push_data function in the api
public function push_data(Request $request)
{
$product_details=new Product;
$product_details->product_title=$request->product_title;
$product_details->product_details=$request->product_details;
$product_details->save();
}
i havent understood why the data is not being pushed to the api.kindly assist here fellow devs