get

Use result of HTTPS GET request [Node.js] [duplicate]

烂漫一生 提交于 2020-12-25 04:58:09
问题 This question already has answers here : How do I return the response from an asynchronous call? (42 answers) Closed 2 years ago . I'm stuck with a small problem I think, but I can't find a way to solve it. I want to load a remote JSON in a variable, using Node.js HTTPS GET request. It's a success, but I can't use it anywhere else in my code. My function is the following (from Node.js doc): function getMyFile() { var https = require('https'); https.get('URL_I_am_targeting/file.json', (res) =>

How can I stop CORS Error with embedded webcam PTZ CGI command [duplicate]

我与影子孤独终老i 提交于 2020-11-30 01:36:17
问题 This question already has answers here : XMLHttpRequest cannot load XXX No 'Access-Control-Allow-Origin' header (10 answers) Closed last year . After upgrading to a new webcam I had to change my code that controls the PTZ on the web cam to: function buttonDown(button) { document.getElementById("status").innerHTML = "button " + button.id + " pressed"; $.get("http://192.168.1.111:88/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveDown&user=user&pwd=pass", function() { //on successful call }); } Now I get this