WpOrg\Requests\Transport
Curl::get_expect_header
Get the correct "Expect" header for the given request data.
Метод класса: Curl{}
Хуков нет.
Возвращает
Строку. The "Expect" header.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_expect_header( $data );
- $data(строка|массив) (обязательный)
- Data to send either as the POST body, or as parameters in the URL for a GET/HEAD.
Код Curl::get_expect_header() Curl::get expect header WP 7.0
private function get_expect_header($data) {
if (!is_array($data)) {
return strlen((string) $data) >= 1048576 ? '100-Continue' : '';
}
$bytesize = 0;
$iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($data));
foreach ($iterator as $datum) {
$bytesize += strlen((string) $datum);
if ($bytesize >= 1048576) {
return '100-Continue';
}
}
return '';
}