Unirest\Request::getFormattedHeaders PHP Méthode

getFormattedHeaders() public static méthode

public static getFormattedHeaders ( $headers )
    public static function getFormattedHeaders($headers)
    {
        $formattedHeaders = array();
        $combinedHeaders = array_change_key_case(array_merge(self::$defaultHeaders, (array) $headers));
        foreach ($combinedHeaders as $key => $val) {
            $formattedHeaders[] = self::getHeaderString($key, $val);
        }
        if (!array_key_exists('user-agent', $combinedHeaders)) {
            $formattedHeaders[] = 'user-agent: unirest-php/2.0';
        }
        if (!array_key_exists('expect', $combinedHeaders)) {
            $formattedHeaders[] = 'expect:';
        }
        return $formattedHeaders;
    }