Skip to content

Use HTTP Post when retrieving result #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

tijmenbruggeman
Copy link

When fetching the result of a compression, users call the method result(). This will do a request to an url like:
https://api.tinify.com/output/<randomstring>
This will resolve to a file.

Because it is possible to add commands to this request such as and other commands, the result would be a GET request with a body. Although this is possible, it is not recommended.

Therefor we should change the method to a POST. Shouldn't be a breaking change so patched the version.

- Fix inverted boolean logic for has_commands check
- Ensure GET is used when no commands are present
- Ensure POST is used when commands are present
- Add comprehensive tests for both GET and POST scenarios
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant