Thenbsp\Wechat\Bridge\Http::send PHP Method

send() public method

Send Request
public send ( $asArray = true )
    public function send($asArray = true)
    {
        $options = array();
        // query
        if (!empty($this->query)) {
            $options['query'] = $this->query;
        }
        // body
        if (!empty($this->body)) {
            $options['body'] = $this->body;
        }
        // ssl cert
        if ($this->sslCert && $this->sslKey) {
            $options['cert'] = $this->sslCert;
            $options['ssl_key'] = $this->sslKey;
        }
        $response = (new Client())->request($this->method, $this->uri, $options);
        $contents = $response->getBody()->getContents();
        if (!$asArray) {
            return $contents;
        }
        $array = Serializer::parse($contents);
        return new ArrayCollection($array);
    }