encode request data