When I make a post request to my php api my swift application gives the error:
Garbage at end
This is my json code (just for trying out):
function getTips($params)
{
$blessure = $params[0];
switch($blessure)
{
case "hoofd":
echo '
"hoofd": [
{
"naam": "neus in de kom",
"beschrijving": "neus zit in de kom",
"categorie": "hoofd"
},
{
"naam": "oor in de kom",
"beschrijving": "oor zit in de kom",
"categorie": "hoofd"
}
]
';
break;
default:
header("HTTP/1.0 404 Not Found");
break;
}
}
What am I doing wrong here?