post请求,ie9之前版本都不支持,兼容不了post请求。
get请求,路径长度最大255。路径后面?传参却可以很长很长,所以为了兼容老ie,我们用了这种方式。
今天讲讲java后台注解如何接收这些get,post请求参数:
1.get请求,路径直接传参,没有key
后台接收:-------------------------------
@RequestMapping(value = "/info/{loginKey}", method = RequestMethod.GET)
public WrappedResult info(@PathVariable String loginKey) {
try {
2. get请求,问号?传参
前台请求:-------------------------------
jQuery.support.cors = true;//配置IE9及以下浏览器支持cors跨域ajax访问
var restClient = new RESTClient();
restClient.authorization = cube.authorization('userServer');
var params = "{\"items\":[{\"uname\":\""+nuser+"\",\"pass\":\""+npass+"\",\"type\":\"2\