Spring Boot 处理http请求

Spring Boot 处理http请求

get请求

请求:

/[value]?[RequestParam]=xxx

代码:

package cn.czwfun;

import org.springframework.web.bind.annotation.*;

/**
 * Created by czwin on 2016/11/27.
 */
@RestController
@RequestMapping("/api")
public class CodeforcesAPIHandle {

    @RequestMapping(value = "cfapi", method = RequestMethod.GET)
    @ResponseBody
    public String get(@RequestParam String userid) {
        return userid;
    }

}

你可能感兴趣的:(spring)