"Access-Control-Allow-Origin" is missing. What should be my next step?

I want to extract crop curve data from here:

http://www.treasury.gov/resource-center/data-chart-center/interest-rates/pages/XmlView.aspx?data=yieldyear&year=2015

Below, the request for return returns a status code of 200 (OK), but also a console note indicating that the request for cross-request is blocked because the CORS header 'Access-Control-Allow-Origin' is missing.

$.get('http://www.treasury.gov/resource-center/data-chart-center/interest-rates/pages/XmlView.aspx?data=yieldyear&year=2015', function (data) {
$(data).find("entry").each(function () { // or "item" or whatever suits your feed
    var el = $(this);

    console.log("------------------------");
    console.log("d:NEW_DATE      : " + el.find("d:NEW_DATE").text());
    console.log("d:BC_1MONTH     : " + el.find("d:BC_1MONTH").text());
    console.log("d:BC_3MONTH     : " + el.find("d:BC_3MONTH").text());
});

});

Are there clear rules / laws on data access if Access-Control-Allow-Origin is not set to '*' (public)?

? ; Access-Control-Allow-Origin ? (Access-Control-Allow-Origin Multiple Origin Domains?).

, CORS (https://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross-origin-resource-sharing/). / ? , - , , ?

, ?

+4
1

PHP, XML , javascript , "Access-Control-Allow-Origin". :

$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();

; , , data.gov. .

CKAN API, , CKAN, .

+1

Source: https://habr.com/ru/post/1615100/


All Articles