简体   繁体   English

是否可以将数据从 JavaScript 浏览器应用程序直接发送到本地 python 服务器?

[英]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.

相关问题 将发布数据从 javascript 发送到 python 服务器 - send post data from javascript to python server Nativescript应用程序无需使用服务器即可从本地浏览器接收数据 - Nativescript app to receive data from local browser without using a server 是否可以直接从浏览器向ip /端口发送原始UDP数据包? - Is it possible to send a raw UDP packet directly from the browser to an ip/port? 将图像从浏览器发送到服务器 - 可能吗? - Send image from browser to server - possible? 是否可以从服务器托管HTML和Javascript,但是可以通过我的本地网络发送SOAP请求吗? - Is it possible to host HTML and Javascript from server, but have it send SOAP request over my local network? 我可以从浏览器中运行的JavaScript直接连接到Redis服务器吗? - Can I connect directly to a Redis server from JavaScript running in a browser? 将数据从javascript发送到服务器 - Send data from javascript to server 网站:将数据从javascript(客户端)发送到python(服务器) - Website: Send data from javascript (client) to python (server) 是否可以将URL从浏览器上运行的javascript发送到客户端计算机上运行的python程序? - Is it possible to send a URL from javascript running on the browser to the python program running on the client machine? 如何将地理位置数据从浏览器发送到服务器? - How to send Geolocation data from browser to server?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM