为了实现这个目标,我必须确定媒体的类型,为了做到这一点,我想对URL进行AJAX请求并获取Content-Type标题,但我在文档中找不到类似的东西.
你有一些提示吗?
$http({method: 'GET',url: '/someUrl'}). success(function(data,status,headers,config) { var contentType = headers('Content-Type'); // use the content-type here })