请求参数带中文 请求格式: http://localhost/common/user/{username}username是中文格式如果直接 http://localhost/common/user/周哈 发送请求,会报错 解决方式 我们需要首先将后面的username进行转码 转码方法为http://localhost/common/user/ + encodeURIComponent("username")转码之后的url如下示例: