Postman使用
文章目录Postman使用1.界面介绍2.Get请求3.Post请求3.1 表单类参数3.2 文件上传3.3 json参数Postman使用Postman 是一款 API 测试工具提供了一种简单易用的方式来测试和调试 API可以帮助开发者简化测试流程提高效率。它于 2012 年创建最初是作为一个 Chrome 浏览器插件推出的大受欢迎以后接着又推出了 web 网页版和桌面客户端。现在Postman 已经成为了互联网开发中最流行的 API 测试工具之一。1.界面介绍2.Get请求GetMapping(getTest1)publicStringgetTest1(RequestParam(no)Stringno,RequestParam(name)Stringname){returnno is no, name is name;}3.Post请求3.1 表单类参数PostMapping(postTest1)publicStringpostTest1(RequestParam(no)Stringno,RequestParam(name)Stringname){returnno is no, name is name;}3.2 文件上传PostMapping(postTest2)publicStringpostTest2(RequestParam(file)MultipartFilemyFile){returntype:myFile.getContentType() fileName:myFile.getOriginalFilename() size:myFile.getSize();}3.3 json参数PostMapping(postTest3)publicStringpostTest3(RequestBodyUseruser){returnJSONObject.toJSONString(user);}
