diff --git a/src/ddb.erl b/src/ddb.erl index ff8d415..7c20dfd 100644 --- a/src/ddb.erl +++ b/src/ddb.erl @@ -377,12 +377,12 @@ update_action('delete') -> <<"DELETE">>. -spec request(string(), json()) -> json_reply(). request(Target, JSON) -> - Body = jsx:to_json(JSON), + Body = jsx:term_to_json(JSON), lager:debug("request: json = ~p", [Body]), Headers = headers(Target, Body), Opts = [{'response_format', 'binary'}], F = fun() -> ibrowse:request(?DDB_ENDPOINT, [{'Content-type', ?CONTENT_TYPE} | Headers], 'post', Body, Opts) end, - ddb_aws:retry(F, ?MAX_RETRIES, fun jsx:to_term/1). + ddb_aws:retry(F, ?MAX_RETRIES, fun jsx:json_to_term/1). -spec headers(string(), binary()) -> proplists:proplist().