set max_redirects to fix test
encode test data in JSON