Skip to content

Commit

Permalink
Do not encode data if type is JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
laffra committed Nov 24, 2024
1 parent a53e8dc commit 269843a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ltk/jquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def post(url, payload, handler, kind="json", headers=None):
The handler function is called with the response data.
"""
start = get_time()
payload = window.encodeURIComponent(dumps(payload))
payload = dumps(payload) if isinstance(payload, str) and kind == "json" else payload
@callback
def success(response, *rest): # pylint: disable=unused-argument
data = response if isinstance(response, str) else to_py(response)
Expand Down

0 comments on commit 269843a

Please sign in to comment.