TeknooSoftware / sellsy-client

PHP library to connect your applications to your Sellsy account account using the Sellsy API and build your websites and your platforms on the Sellsy technology.
https://teknoo.software/libraries/sellsy
MIT License
17 stars 16 forks source link

Fix "400 Bad request" on Document.create #22

Closed fdglefevre closed 4 years ago

fdglefevre commented 4 years ago

Hi,

I'm using this client to create documents on Sellsy but I receive a "400 Bad Request" response code.

$client->Document()->create(['document' => [...], 'row' => [...]]])->getResponse();

I tried to use Postman to do the same request manually and it worked fine. So after some research I found that your client is sending a header Expect with no value whereas Postman don't.

So I propose to remove this header (this resolves the problem) or maybe to give it a correct value. (no tried) See : https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expect

Have a nice day! 🌞

frenchcomp commented 4 years ago

Thanks