Skip to content

Commit 936d93c

Browse files
committed
fix(API): Use GET only when no body
1 parent aba0dc2 commit 936d93c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tinify/source.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ def store(self, **options): # type: (Any) -> ResultMeta
6565
return ResultMeta(response.headers)
6666

6767
def result(self): # type: () -> Result
68-
response = tinify.get_client().request('GET', self.url, self.commands)
68+
if not self.commands:
69+
response = tinify.get_client().request('GET', self.url, self.commands)
70+
else:
71+
response = tinify.get_client().request('POST', self.url, self.commands)
6972
return Result(response.headers, response.content)
7073

7174
def to_file(self, path): # type: (Union[str, IO]) -> None

0 commit comments

Comments
 (0)