Answer the question
In order to leave comments, you need to log in
Why are 2 headers being passed?
Help me figure out why 2 headers are being sent if I use blade mapping
public function __construct()
{
header('Content-type: text/html; charset=windows-1251', true, 200);
$html = file_get_contents('https://www.kinopoisk.ru/top/lists/322/filtr/all/sort/year/');
phpQuery::newDocument('<meta charset="windows-1251">' . $html);
$section = pq('#itemList')->html();
//echo $section;
//exit();
return view('pars_html.main', ['section' => $section]);
}
<!doctype html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta name="csrf-token" content="{{ csrf_token() }}">
<body>
<div class="container">
<div class="row">
<form method="post" action="{{ route('searchParsHTMLPost') }}">
{{csrf_field()}}
<input type="text" name="uid"><br>
<input type="submit" name="search" value="search">
</form>
@yield('content')
{!! $section !!}
</div>
</div>
</body>
</html>
//echo $section;
//exit();
Answer the question
In order to leave comments, you need to log in
return response()
->view('pars_html.main', ['section' => $section], 200)
->header('Content-type: text/html; charset=windows-1251');
Well, you yourself pass the second one on the third line of the constructor.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question