标签:ati ltm for htm status stp control 表单 builder
GET:
1.路径参数@PathVariable
2.表单参数@RequestParam
POST:
1.JSON请求体参数
@RequestBody
放:
1.路径参数@PathVariable
2.表单参数@RequestParam
删除:
1.路径参数@PathVariable
2.表单参数@RequestParam
MockMvc:
1.路径请求
mockMvc.perform(MockMvcRequestBuilders
.请求方式(“url / {path}”,参数值)
2.表单请求
mockMvc.perform(MockMvcRequestBuilders
.请求方式(“url”).param(“键”,“值”).contentType(MediaType.APPLICATION_FORM_URLENCODED)
3.JSON请求
MvcResult mvcResult= mvc.perform( MockMvcRequestBuilders.post("http://127.0.0.1:8080/index"). content(jsonObject.toString()). contentType(MediaType.APPLICATION_JSON) ). andExpect(MockMvcResultMatchers.status().isOk()). andDo(MockMvcResultHandlers.print()). andReturn();
)
原文地址:https://blog.csdn.net/wang_muhuo/article/details/84655577
标签:ati ltm for htm status stp control 表单 builder
原文地址:https://www.cnblogs.com/jpfss/p/10966481.html