@@ -13,7 +13,6 @@ def __init__(self, config: Config) -> None:
13
13
self .config = config
14
14
self .headers = {
15
15
'X-Meili-Api-Key' : self .config .api_key ,
16
- 'Content-Type' : 'application/json'
17
16
}
18
17
19
18
def send_request (
@@ -27,7 +26,7 @@ def send_request(
27
26
self .headers ['Content-Type' ] = content_type
28
27
try :
29
28
request_path = self .config .url + '/' + path
30
- if not content_type :
29
+ if not content_type or content_type == 'application/json' :
31
30
request = http_method (
32
31
request_path ,
33
32
timeout = self .config .timeout ,
@@ -57,16 +56,17 @@ def post(
57
56
self ,
58
57
path : str ,
59
58
body : Optional [Union [Dict [str , Any ], List [Dict [str , Any ]], List [str ]]] = None ,
60
- content_type : Optional [str ] = None ,
59
+ content_type : Optional [str ] = 'application/json' ,
61
60
) -> Any :
62
61
return self .send_request (requests .post , path , body , content_type )
63
62
64
63
def put (
65
64
self ,
66
65
path : str ,
67
66
body : Optional [Union [Dict [str , Any ], List [Dict [str , Any ]], List [str ]]] = None ,
67
+ content_type : Optional [str ] = 'application/json' ,
68
68
) -> Any :
69
- return self .send_request (requests .put , path , body )
69
+ return self .send_request (requests .put , path , body , content_type )
70
70
71
71
def delete (
72
72
self ,
0 commit comments