
SwooleHttpResponse::header 메소드는 하나의 헤더만 설정할 수 있습니다. 여러 개의 헤더를 한번에 설정하려면, 여러 번 호출하거나 array 형태로 전달하는 방법이 있습니다.
#hostingforum.kr
php
// 여러 번 호출하는 방법
$response->header('Content-Type', 'application/json');
$response->header('Set-Cookie', 'cookie=value');
// array 형태로 전달하는 방법
$response->header([
'Content-Type' => 'application/json',
'Set-Cookie' => 'cookie=value',
]);
이러한 방법으로 여러 개의 헤더를 한번에 설정할 수 있습니다.
2025-06-29 15:21