I've tried to create an HTTP request via the Guzzle libary, but it outputs the error
Cannot use object of type stdClass as array
$body = array("foo" => "bar");
$response = self::$client->request("POST", $url, array(
"form_params" => $body,
"auth" => $auth
));
I tried the following and it worked:
$response = self::$client->request("POST", $url, array(
"form_params" => array("foo" => "bar"),
"auth" => $auth
));
Sadly this isn't the solution I'm searching for, because I want to use it in a generic method, where I transfer the form parameters from another class.
P.S. I've found the following post, but it got obvious problems that I don't have in my code: Guzzle form_params not accepting array