HTTPRequest::set_header PHP Method

set_header() protected method

called internally for every header received
protected set_header ( $k, $v )
    protected function set_header($k, $v)
    {
        $k = trim($k);
        $v = ltrim($v);
        // is expect header?
        if (strtolower($k) == 'expect' && strtolower($v) == '100-continue') {
            $this->expect = true;
        }
        // is multipart form data?
        if (strtolower($k) == 'content-type') {
            $ctype = explode(';', $v);
            if (count($ctype) == 2 && strtolower(trim($ctype[0])) == 'multipart/form-data') {
                $boundary = explode('=', trim($ctype[1]));
                if (strtolower(trim($boundary[0])) == 'boundary') {
                    JAXLLogger::debug("multipart with boundary {$boundary['1']} detected");
                    $this->multipart = new HTTPMultiPart(ltrim($boundary[1]));
                }
            }
        }
        $this->headers[trim($k)] = trim($v);
    }