From a16bad2088b96b8e1d2f1dc52bdc9473c420f99a Mon Sep 17 00:00:00 2001 From: Alex Harano <--unset> Date: Wed, 5 Apr 2023 21:29:40 -0300 Subject: [PATCH] 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` --- rollbar/lib/_async.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rollbar/lib/_async.py b/rollbar/lib/_async.py index b41dc2f7..26528f8e 100644 --- a/rollbar/lib/_async.py +++ b/rollbar/lib/_async.py @@ -138,7 +138,7 @@ async def _post_api_httpx(path, payload_str, access_token=None): ) as client: resp = await client.post( url, - data=payload_str, + content=payload_str, headers=headers, timeout=rollbar.SETTINGS.get('timeout', DEFAULT_TIMEOUT), )