neoxygen / neo4j-neoclient

Simple PHP HttpClient for the Neo4j ReST API with Multi DB Support
MIT License
121 stars 138 forks source link

Guzzle HTTP says body request option for POST is deprecated. #72

Closed designersheep closed 8 years ago

designersheep commented 8 years ago

I'm using Xampp with PHP 5.6.14 and I've just installed neo4jclient using composer. I've tried setting up neoclient with the following code as documented on the main page:

$client = ClientBuilder::create()
    ->addDefaultLocalConnection()
    ->build();

and I am getting the following exception. Any help would be appreciated :)

Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Passing in the "body" request option as an array to send a POST request has been deprecated. Please use the "form_params" request option to send a application/x-www-form-urlencoded request, or a the "multipart" request option to send a multipart/form-data request.' in C:\xampp\htdocs\testapp\vendor\guzzlehttp\guzzle\src\Client.php:391 Stack trace: #0 C:\xampp\htdocs\testapp\vendor\guzzlehttp\guzzle\src\Client.php(117): GuzzleHttp\Client->invalidBody() #1 C:\xampp\htdocs\testapp\vendor\guzzlehttp\guzzle\src\Client.php(129): GuzzleHttp\Client->requestAsync('POST', 'http://localhos...', Array) #2 C:\xampp\htdocs\testapp\vendor\neoxygen\neoclient\src\HttpClient\GuzzleHttpClient.php(69): GuzzleHttp\Client->request('POST', 'http://localhos...', Array) #3 C:\xampp\htdocs\testapp\vendor\neoxygen\neoclient\src\Command\AbstractCommand.php(45): Neoxygen\NeoClient\HttpClient\GuzzleHttpClient->sendRequest(Object(Neoxygen\NeoClie in C:\xampp\htdocs\testapp\vendor\guzzlehttp\guzzle\src\Client.php on line 391

Here are the versions of the libraries installed:

>composer require neoxygen/neoclient
Using version ^3.3 for neoxygen/neoclient
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing psr/http-message (1.0)
    Loading from cache

  - Installing graphaware/neo4j-response-formatter (1.2.0)
    Loading from cache

  - Installing symfony/event-dispatcher (v2.7.6)
    Loading from cache

  - Installing symfony/dependency-injection (v2.7.6)
    Loading from cache

  - Installing symfony/filesystem (v2.7.6)
    Loading from cache

  - Installing symfony/config (v2.7.6)
    Loading from cache

  - Installing symfony/yaml (v2.7.6)
    Loading from cache

  - Installing psr/log (1.0.0)
    Loading from cache

  - Installing monolog/monolog (1.17.2)
    Loading from cache

  - Installing guzzlehttp/promises (1.0.3)
    Loading from cache

  - Installing guzzlehttp/psr7 (1.2.1)
    Loading from cache

  - Installing guzzlehttp/guzzle (6.1.0)
    Loading from cache

  - Installing neoxygen/neoclient (3.3.12)
    Loading from cache
ikwattro commented 8 years ago

Thanks for reporting this. I didn't get this issue yet, I'll narrow and fix it asap

ikwattro commented 8 years ago

@designersheep Can you post the code you are using that trigger this exception, as instantiating the client doesn't send any request, I need to narrow down a reproducable behavior.

vukanac commented 8 years ago

This was due to use of Guzzle 6.x while use case is for Guzzle < 6.0. Instead of body param, use form_params.