encode request