yii\httpclient\Request::send PHP Method

send() public method

Sends this request.
public send ( ) : Response
return Response response instance.
    public function send()
    {
        return $this->client->send($this);
    }

Usage Example

Beispiel #1
0
 /**
  * Sends the given HTTP request, returning response data.
  * @param \yii\httpclient\Request $request HTTP request to be sent.
  * @return array response data.
  * @throws InvalidResponseException on invalid remote response.
  * @since 2.1
  */
 protected function sendRequest($request)
 {
     $response = $request->send();
     if (!$response->getIsOk()) {
         throw new InvalidResponseException($response, 'Request failed with code: ' . $response->getStatusCode() . ', message: ' . $response->getContent());
     }
     return $response->getData();
 }