public function addHttpHeader($http_header, $value)
    {
        $field = EnumRequestOption::HTTP_HEADERS;
        $http_headers = isset($this->options[$field]) ? $this->options[$field] : [];

        foreach($http_headers as $key => $header){
            if (strpos($header, $http_header) === 0){
                $http_headers[$key] = "$http_header: $value\r\n";
                return;
            }
        }

        $http_headers[$http_header] = $value;
        $this->options[$field] = $http_headers;
    }
public function addHttpHeader($http_header, $value)
    {
        $field = EnumRequestOption::HTTP_HEADERS;
        $http_headers = isset($this->options[$field]) ? $this->options[$field] : [];

        foreach($http_headers as $key => $header){
            if (strpos($header, $http_header) === 0){
                $http_headers[$key] = "$http_header: $value\r\n";
                return;
            }
        }

        $http_headers[$http_header] = $value;
        $this->options[$field] = $http_headers;
    }
public function addHttpHeader ( $ http_header , $ value ) { $ field = EnumRequestOption :: HTTP_HEADERS ; $ http_headers = isset ( $ this -> options [ $ field ] ) ? $ this -> options [ $ field ] : [ ] ; foreach ( $ http_headers as $ key => $ header ) { if ( strpos ( $ header , $ http_header ) === 0 ) { $ http_headers [ $ key ] = "$http_header: $value\r\n" ; return ; } } $ http_headers [ $ http_header ] = $ value ; $ this -> options [ $ field ] = $ http_headers ; }
Add HTTP Header

@param string $http_header
@param string $value
Add HTTP Header