public function __construct($parts, $boundary = null, $statusCode = 200, array $headers = array()) { if ($boundary === null) { $boundary = uniqid(); } $this->boundary = $boundary; $headers["content-type"] = "multipart/mixed; boundary=" . $this->boundary; if (!isset($headers["content-transfer-encoding"])) { $headers["content-transfer-encoding"] = "binary"; } parent::__construct($parts, $statusCode, $headers); }
public function __construct($content, $statusCode = 200, array $headers = array()) { $headers['content-type'] = 'application/json'; parent::__construct($content, $statusCode, $headers); }
public function __construct($url, $statusCode = 302, array $headers = array()) { $headers['location'] = $url; parent::__construct($url, $statusCode, $headers); }