我正在尝试使用封面艺术存档 api。封面艺术档案
var request:URLRequest = new URLRequest();
request.url = "http://coverartarchive.org/release/76df3287-6cda-33eb-8e9a-044b5e15ffdd/";
request.method = URLRequestMethod.GET;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.TEXT;
loader.addEventListener(Event.COMPLETE, loaderComplete);
loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
loader.load(request);
function loaderComplete(evt:Event):void {
trace("Load Succcsed");
}
function ioErrorHandler(evt:IOErrorEvent):void {
trace("io: " + evt + "\n");
}
function httpStatusHandler(evt:HTTPStatusEvent):void {
trace("status: " + evt + "\n");
}
但我得到的是:
状态:[HTTPStatusEvent type="httpStatus" bubbles=false cancelable=false eventPhase=2 status=0 responseURL=null]
io: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://coverartarchive.org/release/76df3287-6cda-33eb-8e9a-044b5e15ffdd/ "]
谁能告诉我我做错了什么?
谢谢
编辑1:添加:reqest.requestHeaders = new Array(new URLRequestHeader("accept", "application/json")); 还是不行。。。