반응형

요청: application/json

{

    "title":"upload test"

}

 

결과

 

요청:

{

      "course":"1",            

    "title":"upload test",

    "filename":"upload test",

    "distance":"1.1",

    "moving_time_str":"24:59:59",

    "total_time_str":"23:59:59",

    "moving_time_sec":"10",

    "total_time_sec":"10",

    "avg_speed":"1.0",

    "avg_pace":"1.0",

    "location":"인하대학교",

    "latitude":"37.44659903926295",

    "longitude":"126.65384268084867",

    "max_height":"1000",

    "min_height":"10",

    "ele_dif":"990",

    "total_uphill":"10",

    "total_downhill":"10",

    "difficulty":"중",

    "calorie":"0",

    "date":"2021-06-11T02:24:47.921514",

    "gpx_url":"...",

    "thumbnai":"..."

}

결과

@RequestBody String str

: str에 json이 그대로 저장됨

 

 

@RequestBody를 객체로 바로 전달받을 수 있음

이때, TestDto 클래스에 @AAC가 붙으면 에러발생, @Getter와 @Setter만 있어야 함

 

 

반응형

+ Recent posts