[Slim 2] foreach loop to $request->post('array') sent via Ajax

I am trying to send the serialize string of Jquery sortable to a post method via AJAX

the string it is sending is:
category[]=48&category[]=47

normally, via $_POST, i will just need to:

$i = 0;
$str = "";
foreach ($_POST['category'] as $value) {
   // Execute statement:
   $str .= "UPDATE [Table] SET [Position] =". $i ."WHERE [categoryId] =". $value;
   $i++;
}

echo $str;

but trying it on Slim:

$request = $app->request;
$cats = $request->post('category');

$i = 0;
$str = "";
foreach ($cats as $value) {
  $str .= "UPDATE [Table] SET [Position] =". $i ."WHERE [categoryId] =". $value;
  $i++;
}

echo $str;

I am getting empty string, any reason why?

– EDIT –

seems like my only option is to parse_str() the post?

Sounds like you are having a problem with sending correct data in Angular…

Please check the content-type header of your request. If it is not recognized by slim then the body wont’ get parsed properly.