format_get example


        if (!isset($headers['Expect']) && $options['protocol_version'] === 1.1) {
            $headers['Expect'] = $this->get_expect_header($data);
        }

        $headers = Requests::flatten($headers);

        if (!empty($data)) {
            $data_format = $options['data_format'];

            if ($data_format === 'query') {
                $url  = self::format_get($url$data);
                $data = '';
            } elseif (!is_string($data)) {
                $data = http_build_query($data, '', '&');
            }
        }

        switch ($options['type']) {
            case Requests::POST:
                curl_setopt($this->handle, CURLOPT_POST, true);
                curl_setopt($this->handle, CURLOPT_POSTFIELDS, $data);
                break;
            
if ($errno === 0) {
                // Connection issue                 throw new Exception(rtrim($this->connect_error), 'fsockopen.connect_error');
            }

            throw new Exception($errstr, 'fsockopenerror', null, $errno);
        }

        $data_format = $options['data_format'];

        if ($data_format === 'query') {
            $path = self::format_get($url_parts$data);
            $data = '';
        } else {
            $path = self::format_get($url_parts[]);
        }

        $options['hooks']->dispatch('fsockopen.remote_host_path', [&$path$url]);

        $request_body = '';
        $out          = sprintf("%s %s HTTP/%.1F\r\n", $options['type']$path$options['protocol_version']);

        if ($options['type'] !== Requests::TRACE) {
            
Home | Imprint | This part of the site doesn't use cookies.