@@ -233,7 +233,6 @@ def _get_session(self):
233
233
headers = {
234
234
'X-Apikey' : self ._apikey ,
235
235
'Accept-Encoding' : 'gzip' ,
236
- 'Content-Type' : 'application/json' ,
237
236
'User-Agent' : _USER_AGENT_FMT .format_map ({
238
237
'agent' : self ._agent , 'version' : __version__ })
239
238
}
@@ -577,6 +576,11 @@ def patch_object(self, path, *path_args, obj):
577
576
async def patch_object_async (self , path , * path_args , obj ):
578
577
"""Like :func:`patch_object` but returns a coroutine."""
579
578
data = json .dumps ({'data' : obj .to_dict (modified_attributes_only = True )})
579
+
580
+ if self ._user_headers is None :
581
+ self ._user_headers = {}
582
+ self ._user_headers ['Content-Type' ] = 'application/json'
583
+
580
584
response = await self .patch_async (path , * path_args , data = data )
581
585
return await self ._response_to_object (response )
582
586
@@ -624,6 +628,11 @@ def post_object(self, path, *path_args, obj):
624
628
async def post_object_async (self , path , * path_args , obj ):
625
629
"""Like :func:`post_object` but returns a coroutine."""
626
630
data = json .dumps ({'data' : obj .to_dict ()})
631
+
632
+ if self ._user_headers is None :
633
+ self ._user_headers = {}
634
+ self ._user_headers ['Content-Type' ] = 'application/json'
635
+
627
636
response = await self .post_async (path , * path_args , data = data )
628
637
return await self ._response_to_object (response )
629
638
0 commit comments