only json-encode in case body is array or hashmap