Skip to content

Commit 4635314

Browse files
committed
Handle body as boolean for POST HTTP requests
Required for facet-search settings and possibly others.
1 parent a43baec commit 4635314

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

meilisearch/_httprequests.py

+10
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def send_request(
3333
Mapping[str, Any],
3434
Sequence[Mapping[str, Any]],
3535
List[str],
36+
bool,
3637
bytes,
3738
str,
3839
int,
@@ -60,6 +61,14 @@ def send_request(
6061
headers=self.headers,
6162
data=body,
6263
)
64+
elif isinstance(body, bool):
65+
data = json.dumps(body)
66+
request = http_method(
67+
request_path,
68+
timeout=self.config.timeout,
69+
headers=self.headers,
70+
data=data,
71+
)
6372
else:
6473
serialize_body = isinstance(body, dict) or body
6574
data = (
@@ -111,6 +120,7 @@ def put(
111120
Mapping[str, Any],
112121
Sequence[Mapping[str, Any]],
113122
List[str],
123+
bool,
114124
bytes,
115125
str,
116126
int,

0 commit comments

Comments
 (0)