'Access-Control-Allow-Origin ' Missing. What should be my next step?

泪湿孤枕 提交于 2019-12-05 16:57:48

I resolved this issue with PHP, it was possible to pull the XML from the server side as opposed to the client side javascript attempt that was causing the 'Access-Control-Allow-Origin' issue. Code here:

$url = "http://www.treasury.gov/resource-center/data-chart-center/interest-rates/pages/XmlView.aspx?data=yieldyear&year=2015";
$xml = simplexml_load_file($url);
echo $xml->asXML();

In my research I went down the wrong track for a little while; the treasury yield curve data I was looking for is part of the government's data.gov project. They have a site for developers here.

My initial thought was to use the CKAN API but it seems that they only store metadata in CKAN, not the actual data.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!