dojo中 xhr.post向后台传参出现乱码

在js文件中加入

headers: { "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}, 

var content = {"field":"参数名称"};
xhr.post({
	url :  config.contextPath+"/getData/showfields",
	handleAs : 'json',
    content:content,
    headers: { "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}, 
    load : lang.hitch(this, function(response){
					this._pointFieldsAlians(feature,response);
	}),
	error : function(response, ioArgs) {
		}
	});

猜你喜欢

转载自blog.csdn.net/wml00000/article/details/83344286
今日推荐