encode request payload