package cn.netkiller.api.restful;
import java.util.List;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class TestRestController {
@RequestMapping(value = "/test/list/{siteId}", method = RequestMethod.POST)
public List<String> ping(@PathVariable("siteId") int siteId, @RequestBody List<String> tags) {
System.out.println(String.format("%d, %s", siteId, tags));
return (tags);
}
}
$ curl -H "Content-Type: application/json" -X POST -d '["Neo","Netkiller"]' http://localhost:8440/test/list/22.json
["Neo","Netkiller"]