Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

symfony set content type

use SymfonyComponentHttpFoundationResponse;

$response = new Response();
$response->setContent(json_encode([
    'data' => 123,
]));
$response->headers->set('Content-Type', 'application/json');
Source by symfony.com #
 
PREVIOUS NEXT
Tagged: #symfony #set #content #type
ADD COMMENT
Topic
Name
5+8 =