import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("Index")
public class IndexController
{
@RequestMapping(value="index",method={RequestMethod.GET,RequestMethod.POST},produces="text/html;charset=utf-8")
@ResponseBody
public String index()
{
String sid = "1";
String apiUrl = "http://www.xxxxx.com/api/" +sid;
String data = HttpRequest.get(apiUrl,null); //开始模仿赏识器哀求
JSONObject json = JSONObject.fromObject(data); //理会返回的json数据功效
}
}
以上就是本文的所有内容,但愿对各人的进修有所辅佐,也但愿各人多多支持编程之家。 (编辑:湖南网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|