user3599441
user3599441

Reputation:

Attempted to call an undefined method named "request" of class "Zend\Http\Client"

I get the error that is the title, and this is the line of code he is complaining about;

$client = new Client($passwordResetUrl, array('timeout' => 30));
$client->setParameterPost(array("username" => $username,
                                "application" => "pw_solcon",
                                "requester" => $requester,
                                "method" => $method));                
$response = $client->request(Client::POST);
if ($response->getStatus() == 200) {
     //do something
}

It complains specifically about $response = $client->request(Client::POST);

I looked at the documentation here, but I don't get what I am doing wrong.

Can somebody please help me?

Thank you

Upvotes: 1

Views: 771

Answers (1)

codisfy
codisfy

Reputation: 2183

You are using Zend framework 2 and using documentation for Zend Framework 1

use this as your reference.

ZF2 uses $response = $client->send();

Upvotes: 1

Related Questions