Skip to content
This repository was archived by the owner on Dec 8, 2023. It is now read-only.

Commit c9c7caf

Browse files
authored
fix: don't set content if body is None (#31)
1 parent f9df3e7 commit c9c7caf

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

alma_client/request.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
from typing import Optional
23

34
import httpx
45

@@ -65,8 +66,8 @@ def delete(self):
6566
return self
6667

6768
@property
68-
def data(self):
69-
return json.dumps(self.body)
69+
def data(self) -> Optional[bytes]:
70+
return json.dumps(self.body).encode("utf-8") if self.body is not None else None
7071

7172
def to_httpx(self):
7273
self.context.credentials.configure(self)

0 commit comments

Comments
 (0)