[英]Is it possible to send data from a JavaScript browser app to a local python server directly?
As the question suggests I'm trying to find a way using JavaScript to send some data to a local python server.正如问题所暗示的那样,我正在尝试找到一种使用 JavaScript 将一些数据发送到本地 python 服务器的方法。 I know that using javascript.我知道使用 javascript。 I know that browser JS can't import any libraries via "Require".我知道浏览器 JS 无法通过“Require”导入任何库。 Does anyone know of a method using JS on its own?有谁知道一种单独使用 JS 的方法?
Yes.是的。
Make your Python app listen for HTTP requests , and then use the Fetch API from JavaScript.让您的Python 应用侦听 HTTP 请求,然后从 JavaScript 使用Fetch API 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.