Skip to content

Commit a16bad2

Browse files
author
Alex Harano
committed
Replace httpx.post data kwarg with content
As described in https://github.com/encode/httpx/blame/08a557e3e2b9220b90ee21238e316206ffa65d36/docs/compatibility.md?plain=1#L70-L90 the `data` parameter in `httpx.post` was intended to provide compatibility from `requests`, but as it does not provide anymore for this end, it issues a warning `DeprecationWarning: Use 'content=<...>' to upload raw bytes/text content.` when using `pyrollbar` is used with `asyncio`
1 parent c3b6510 commit a16bad2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rollbar/lib/_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ async def _post_api_httpx(path, payload_str, access_token=None):
138138
) as client:
139139
resp = await client.post(
140140
url,
141-
data=payload_str,
141+
content=payload_str,
142142
headers=headers,
143143
timeout=rollbar.SETTINGS.get('timeout', DEFAULT_TIMEOUT),
144144
)

0 commit comments

Comments
 (0)