xmlhttprequest

Use node-XMLHttpRequest through a Proxy?

喜夏-厌秋 提交于 2019-12-18 09:39:11
问题 I need to deploy my node-XMLHttpRequest app to a server that uses a proxy to access the internet. In a terminal on that server, I can curl -d "" http://website/path and it works fine. I think curl recognizes the environment variable http_proxy in that case. The node app times out because it doesn't see the proxy. How can I get the node app to use the proxy? For instance, could I use http.globalAgent to send the requests through the proxy? 回答1: Did you provide the proxy options to the http

XMLHttpRequest succeeds without manifest permissions? Maybe CORS?

放肆的年华 提交于 2019-12-18 09:17:55
问题 I have developed a Google Chrome extensions that uses YouTube Data API v2 . My permission field in the manifest looks like this, because the script is injected in pages under youtube.com and I also need access to tabs: "permissions": ["tabs", "*://*.youtube.com/*"] This also works when I do a request to YouTube Data API v2 because the request is done to http://gdata.youtube.com/, so it is the same domain. But now I am migrating to YouTube Data API v3 , and the requests must be done to http:/

What is the concept behind Access-Control-Allow-Origin and CORS?

纵然是瞬间 提交于 2019-12-18 09:15:29
问题 I don't really get Access-Control-Allow-Origin and CORS. If I allow request from any domain to my page, does that imply any security issues for my page? I always thought, that SOP ensures, that there can't run any script on a page, which requests data from another server, as that data might be malicious. But as the server, which serves the malicious data, can just reply with a header containing Access-Control-Allow-Origin:* , everything can be loaded from that server. So as soon as somebody

OPTIONS request for restful cross-domain using CORS

北战南征 提交于 2019-12-18 08:48:06
问题 On client side I'm using Ajax.post (jquery 1.5) with json. On server side I'm using rest resteasy-jaxrs-2.0.1.GA. I found somewhere that i should add couple of headers to server response and I've done with following filter: public void doFilter( ServletRequest req, ServletResponse res, FilterChain filterChain) throws IOException, ServletException { MyServletRequestWrapper httpReq = new MyServletRequestWrapper((HttpServletRequest)req); HttpServletResponse httpRes = (HttpServletResponse)res;

WinJS.xhr local network error

醉酒当歌 提交于 2019-12-18 08:47:09
问题 I am trying to make a simple windows 8 app but I have a problem. When I try to make a xhr request to a local webserver it fails with the error code: 0x2efd Sample code: WinJS.xhr({ url: "http://192.168.0.30" }).then( function completed(response) { //var json = JSON.parse(response.responseText); //var list = new WinJS.Binding.List(json.results); console.log(response.responseText); }, function error(error) { console.log(error) }, function progress(progress) { } ); But when I try a remote IP for

Synchronous XMLHttpRequest deprecated

故事扮演 提交于 2019-12-18 08:40:57
问题 Today, I had to restart my browser due to some issue with an extension. What I found when I restarted it, was that my browser (Chromium) automatically updated to a new version that doesn't allow synchronous AJAX-requests anymore. Quote: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/. I need synchronous AJAX-requests for my node.js applications to work though, as they

Is it possible to send custom headers with an XHR (“Ajax” request)?

大憨熊 提交于 2019-12-18 08:25:57
问题 I'm working with an API which needs extra security information sent along with an HTTP request as meta-information in headers. Is it possible to set those in an XMLHttpRequest? 回答1: Yes, see "The setRequestHeader() method" of the current XMLHttpRequest working draft of 6 December 2012. 来源: https://stackoverflow.com/questions/1180048/is-it-possible-to-send-custom-headers-with-an-xhr-ajax-request

Basic authentication with header - Javascript XMLHttpRequest

﹥>﹥吖頭↗ 提交于 2019-12-18 07:21:04
问题 I am trying to access Adyen test API that requires basic authentication credentials. https://docs.adyen.com/developers/ecommerce-integration My credentials work when accessing the API page through browser. But I get an 401 Unauthorized response when trying to access the API with XMLHttpRequest POST request. Javascript Code var url = "https://pal-test.adyen.com/pal/servlet/Payment/v25/authorise"; var username = "ws@Company.CompanyName"; var password = "J}5fJ6+?e6&lh/Zb0>r5y2W5t"; var

Can I use XMLHttpRequest on a different port from a script file loaded from that port?

牧云@^-^@ 提交于 2019-12-18 05:50:32
问题 I have website that use XMLHttpRequest (jQuery, actually). I also have another site running on the same server, which serves a script file that makes XHR requests back to THAT site, ie. http://mysite:50000/index.html includes <script src="http://mysite:9000/otherscript.js"></script> and http://mysite:9000/otherscript.js includes $.ajax({ url: 'http://mysite:9000/ajax/stuff' }); The problem is - this doesn't work. The AJAX requests from the loaded script simply fail with no error message. From

php setcookie not working with ajax call

一曲冷凌霜 提交于 2019-12-18 05:48:09
问题 I have a page, test.php, with the following code: <html> <body> <form> <script type="text/javascript"> function SendCookies(){ if (window.XMLHttpRequest)/* code for IE7+, Firefox, Chrome, Opera, Safari */ { xmlhttp=new XMLHttpRequest(); } else /* code for IE6, IE5 */ { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status == 200) { alert('done'); } } xmlhttp.open("GET", "/web/DEV/Classes/SetCookie.php?time=" + new