结构体验证 用gin框架的数据验证,可以不用解析数据,减少if else,会简洁许多. 处理请求方法 func structValidator(context *gin.Context) { var person Person if err := context.ShouldBind(&person); err != nil { fmt.Println(err) context.String(http.StatusBadRequest, "failed") return } c
在进行robotframework 接口自动化,在请求体参数中输入中文会报以下错误: UnicodeDecodeError: 'ascii' codec can't decode byte 0xd7 in position 9: ordinal not in range(128)..... 改mimetypes.py文件,路径位于python的安装路径下的Lib\mimetypes.py文件.在import下添加如下几行:解放参考如下: if sys.getdefaultencoding()