使用fidder进行post和get请求

261 阅读1分钟

图片.png
post请求,一定要在请求头里面加上Content-Type,不然在springmvc里面无法获取到参数,只能通过HttpServletRequest获取流,然后才能获取请求体。 Content-Type: application/x-www-form-urlencoded 表单提交方式,键值对 username=zml3&password=123&name=zml3 Content-Type: application/json json格式 {“username”:"zml3","password":"123","name":"zml3"} get方式比较简单,只需要选择get,然后输入地址就行