From cfb07b824108e6c960be82f777b1107615b52682 Mon Sep 17 00:00:00 2001 From: Moritz Pein Date: Tue, 10 Apr 2018 07:08:49 +0200 Subject: [PATCH] fix: Only set content-type header if there is content --- figo/figo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/figo/figo.py b/figo/figo.py index 55c74aa..c619f2a 100644 --- a/figo/figo.py +++ b/figo/figo.py @@ -93,7 +93,6 @@ def __init__(self, """ self.headers = { 'Accept': 'application/json', - 'Content-Type': 'application/json', 'User-Agent': "python_figo/{0}".format(__version__), } self.language = language @@ -116,6 +115,8 @@ def _request_api(self, path, data=None, method="GET"): session = Session() session.headers.update(self.headers) + if data is not None: + session.headers['Content-Type'] = 'application/json' for fingerprint in self.fingerprints: session.mount(self.api_endpoint, FingerprintAdapter(fingerprint.lower()))