ryansh100/bricklink-api

Client.send does not support PUT or POST, making it impossible to add or update anything using the API

Closed this issue · 1 comments

Although no methods exist yet, I want to share that the Client object cannot send PUT or POST requests.

The problem consists of multiple issues:

  • There does not seem to be a way to provide a content body to a request. Whatever you do, the request parameters will always be sent as query string.
  • There is no header Content-Type: application/json configured, even though it's required by BrickLink's API (not stated in docs, but error will be thrown when missing).
  • The OauthHelper does not seem able to correctly sign requests containing a body.

These issues need to be addressed or expansion of the api wrapper cannot progress except for adding more GET requests.

I've started with a WIP in a branch on my fork: https://github.com/halfpastfouram/bricklink-api/commits/store-api. This branch is based on my changes in PR #41.

I've managed to allow PUT and POST requests but am unsure if my chosen approach is the desired one. I've also introduced a new entity: Inventory. The Inventory supports getting one, getting all and updating inventories and has a basic test spec file that could be expanded on.

@ryansh100 Please let me know your thoughts and I will see what I can do to improve before making a PR.