PL / SQL添加响应头

时间:2015-04-02 08:55:44

标签: oracle plsql oracle11g xmlhttprequest plsqldeveloper

我需要在我的PL / SQL过程中添加Access-Control-Allow-Origin标头,以便我可以通过XmlHttpRequest访问另一个域的网页内容。

因为现在出现以下错误:

XMLHttpRequest cannot load http://db:7779/xxxxx. No 'Access-Control-Allow-Origin' header is present on the requested resource. 
Origin 'http://domain' is therefore not allowed access. The response had HTTP status code 501.

这是我的XmlHttpRequest的javascript代码:

function httpGet(theUrl){   //gibt Daten von URL zurueck
    var xmlHttp = null;
    xmlHttp = new XMLHttpRequest();
    xmlHttp.open( "GET", theUrl, false );
    //xmlHttp.withCredentials = true;     //Does this change anything for the response?
    xmlHttp.setRequestHeader( "pragma", "no-cache" );
    xmlHttp.send( null );
    return xmlHttp.responseText;
}

感谢您的帮助

0 个答案:

没有答案