Skip to content

Commit 24b53f9

Browse files
committed
use call caps for http method
1 parent 212c0c3 commit 24b53f9

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

chatkit/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ class AttachmentUploadDescriptor(BaseModel):
730730
"""Two-phase upload instructions."""
731731

732732
url: AnyUrl
733-
method: Literal["put", "post"]
733+
method: Literal["POST", "PUT"]
734734
"""The HTTP method to use when uploading the file for two-phase upload."""
735735
headers: dict[str, str] = Field(default_factory=dict)
736736
"""Optional headers to include in the upload request."""

tests/test_chatkit_server.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ async def create_attachment(
110110
preview_url=AnyUrl(f"https://example.com/{id}/preview"),
111111
upload_descriptor=AttachmentUploadDescriptor(
112112
url=AnyUrl(f"https://example.com/{id}/upload"),
113-
method="put",
113+
method="PUT",
114114
headers={"X-My-Header": "my-value"},
115115
),
116116
)
@@ -121,7 +121,7 @@ async def create_attachment(
121121
name=input.name,
122122
upload_descriptor=AttachmentUploadDescriptor(
123123
url=AnyUrl(f"https://example.com/{id}/upload"),
124-
method="put",
124+
method="PUT",
125125
headers={"X-My-Header": "my-value"},
126126
),
127127
)
@@ -1033,7 +1033,7 @@ async def test_create_file():
10331033
assert attachment.upload_descriptor.url == AnyUrl(
10341034
f"https://example.com/{attachment.id}/upload"
10351035
)
1036-
assert attachment.upload_descriptor.method == "put"
1036+
assert attachment.upload_descriptor.method == "PUT"
10371037
assert attachment.upload_descriptor.headers == {"X-My-Header": "my-value"}
10381038
assert attachment.id in store.files
10391039

@@ -1066,7 +1066,7 @@ async def test_create_image_file():
10661066
assert attachment.upload_descriptor.url == AnyUrl(
10671067
f"https://example.com/{attachment.id}/upload"
10681068
)
1069-
assert attachment.upload_descriptor.method == "put"
1069+
assert attachment.upload_descriptor.method == "PUT"
10701070
assert attachment.upload_descriptor.headers == {"X-My-Header": "my-value"}
10711071

10721072
assert attachment.id in store.files

0 commit comments

Comments
 (0)