Я настроил локально проект Symfony и запускаю его со встроенным сервером Symfony на хост-машине MacOS, и все работает просто великолепно
Код: Выделить всё
{
"my_response" : [
{
"attribute" : "value1"
},
{
"attribute" : "value2"
}
]
}
Код: Выделить всё
{
"my_response" : [
{
"attribute" : "value1"
},
{
"attribute" : "value2"
}
]
}
{
"my_response" : [
{
"attribute" : "value1"
},
{
"attribute" : "value2"
}
]
}
Код: Выделить всё
#[Route('/pathto/apiresponse', name: 'path_to_api')]
public function apiresponse(ApiResponse $apiResponse): Response
{
$response = new Response();
$response->setContent(json_encode($apiResponse->retrieveResponse()));
$response->setStatusCode(Response::HTTP_OK);
$response->headers->set('Content-Type', 'application/json');
return $response->send();
}
Подробнее здесь: https://stackoverflow.com/questions/791 ... e-response
Мобильная версия