box / boxcli

A command line interface for interacting with the Box API.
https://developer.box.com
Apache License 2.0
222 stars 59 forks source link

fix: Fix request command when calling without body #369

Closed arjankowski closed 2 years ago

arjankowski commented 2 years ago

Previously, when a user made a request without passing the body parameter, the Content-Type was set to application/octet-stream.

This was wrong because there was no content, but for some reasons the backend was accepting it and returning the correct respsone. Now the backend probably started validating Content-Type header and returns 400 if it's wrong.

To fix that we just need to make sure we set Content-Type to correct value and only if it needed.