1.定位接口测试 url
2.请求方式:
Get 请求参数作为url传入:
@GET
@Path("/v1/classInfo/{dictSchoolId}/{memberId}/{classStatus}")
@Produces("application/json;charset=UTF-8")
public ListRestFulModel classInfo(@PathParam("dictSchoolId") Long dictSchoolId,
@PathParam("memberId") Long memberId, @PathParam("classStatus") ClassStatus classStatus)
{}
POST:
*/
@POST
@Path("/v1/appPoster/list")
@Produces("application/json;charset=UTF-8")
public ListRestFulModel appPosterList(AppPosterBean appPosterBean)
{}
3.Header
POST : Content-Type : application/json;
GET : charset : UTF-8 ; Content-Type : application/json
4.POST请求传递json格式的参数
json数据用POST传递
Post {http://localhost:8080/xshutong/rest/appPoster/v1/appPoster/list
选择body json参数:
{
"page":{
"pageNumber":1,
"pageSize":12
}
}
请求后台数据。。。。。
5.GET参数传递
GET: http://localhost:8080/xshutong/rest/classAlbumImage/v1/content/1
@GET
@Path("/v1/content/{classAlbumImageId}")
@Produces("application/json;charset=UTF-8")
public ListRestFulModel content(@PathParam("classAlbumImageId") Long classAlbumImageId)
{
上面的太机械 直接上图: