Hi guys,
I’m trying to populate my kirby backend with a route I call and data I attach via POST. Does Kirby have any kind of file size restriction for data coming via route? It seems like half of the data is cut off…
This is the way I call the kirby route:
$obj = json_decode($result);
print_r(count($obj->products));
$fields_string = http_build_query($obj);
$ch2 = curl_init();
curl_setopt($ch2, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch2, CURLOPT_URL, ‘http://localhost:8888/TT18/cms/shopifyupdate’);
// curl_setopt($ch2,CURLOPT_POST, count($fields));
curl_setopt($ch2,CURLOPT_POSTFIELDS, $fields_string);
$result = curl_exec($ch2);
if($result){
$obj = json_decode($result);
print_r(’ success ->’.$result);
curl_close($ch2);
}
This is the way I receive it in kirby:
c::set(‘routes’, array(
array(
‘pattern’ => array(‘shopifyupdate’),
‘action’ => function() {
// do something here when the URL matches the pattern above
$response = array();
$musicItems = page('music')->children();
foreach($musicItems as $mitem) {
$mitem->delete();
}
$clothingItems = page('clothing')->children();
foreach($clothingItems as $citem) {
$citem->delete();
}
foreach( $_POST as $stuff ) {
array_push($response, count($stuff));
}
echo json_encode($response);
},
'method' => 'POST'
)
Thank you
Ben