OSS\Http\RequestCore::__construct PHP Method

__construct() public method

Constructs a new instance of this class.
public __construct ( string $url = null, string $proxy = null, array $helpers = null )
$url string (Optional) The URL to request or service endpoint to query.
$proxy string (Optional) The faux-url to use for proxy settings. Takes the following format: `proxy://user:pass@hostname:port`
$helpers array (Optional) An associative array of classnames to use for request, and response functionality. Gets passed in automatically by the calling class.
    public function __construct($url = null, $proxy = null, $helpers = null)
    {
        // Set some default values.
        $this->request_url = $url;
        $this->method = self::HTTP_GET;
        $this->request_headers = array();
        $this->request_body = '';
        // Set a new Request class if one was set.
        if (isset($helpers['request']) && !empty($helpers['request'])) {
            $this->request_class = $helpers['request'];
        }
        // Set a new Request class if one was set.
        if (isset($helpers['response']) && !empty($helpers['response'])) {
            $this->response_class = $helpers['response'];
        }
        if ($proxy) {
            $this->set_proxy($proxy);
        }
        return $this;
    }