add an query encoding loop for make_request

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>