Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
164 views

My code is using SSE technique (Server-Sent Events) to send Jpeg images every time a camera-viewer object is updated with a new frame. I'm using Python 3.9.13. Inside `do_GET I have this code: self....
ishahak's user avatar
  • 6,845
1 vote
0 answers
399 views

I'm new in API creation and cannot create correct server code to return JSON data from POST request. I have a Python class that inherits BaseHTTPRequestHandler and implements the method do_POST. ...
Vladislav's user avatar
0 votes
1 answer
80 views

I've encountered an unusual behavior with Python's HTTPServer. My computer has both Ethernet and WiFi connections active simultaneously. I intended for the server to exclusively respond to incoming ...
ishahak's user avatar
  • 6,845
0 votes
0 answers
668 views

I am currently experiencing a strange issue when attempting to set up a publicly available internet server. I am seeking some insight into where I may be going wrong. I am pretty new to this sort of ...
alex neu's user avatar
0 votes
1 answer
360 views

This is my first time posting and I'm running into quite the issue. Unlike most people who want their code to execute a command and wait for it to finish, I want to launch it in a new terminal window ...
SpaceSaver2000's user avatar
1 vote
1 answer
606 views

I tried implementing a custom data loader that will make a web request and will return a sample. My purpose of the program is to see if this idea would be faster than the original data loader. My web ...
Alex Tan's user avatar
3 votes
0 answers
1k views

I'd like to ask about System Idle Process where it seems to be occupying a specific port that I'm using. I'm suspecting this is the reason why my BaseHTTPServer python script that listens to requests ...
Alex's user avatar
  • 31
1 vote
1 answer
2k views

Let's say there is a path "D:/test.zip", and I have successfully built a server based on BaseHTTPServer( the server is listening on http://127.0.0.1:6000). Its handler class is like this: ...
vainquit's user avatar
  • 587
1 vote
0 answers
1k views

Situation: Need 2 ad-hoc Python3 http.server instances on the same computer. Problem: The first server was started successfully on the command line python3 -m http.server 8888 The second server was ...
Timothy Wong's user avatar
0 votes
1 answer
820 views

I am sending an image from my HTML-JS frontend to my Python backend. Below is my JS code: var formData = new FormData(); formData.append("a", file); var xhr = new XMLHttpRequest(); xhr....
Pranit Bankar's user avatar
0 votes
1 answer
682 views

Apologies but I am super unfamiliar with Python httpserver. I am also aware of the vulnerabilities or limitations of it, but it is ideal for my needs. I have about 10 lines of code that are running ...
Joe Fedorowicz's user avatar
0 votes
2 answers
873 views

BaseHTTPServer cannot be instantiated with port 443. I guess this is prevented to avoid collision with some other https services. Therefore, I've tried to define SNI to this server using the ...
Zohar81's user avatar
  • 5,214
0 votes
0 answers
110 views

Please tell me in what form should I give the status of the server and the body of response from my application in uwsgi for proper work ? import BaseHTTPServer import AppLogic class ...
verona's user avatar
  • 1
0 votes
0 answers
2k views

I'm trying to send a POST request to localhost and was getting an error about CORS not being allowed. I added an "Access-Control-Allow-Origin: *" header among other things based on what other people ...
atjin's user avatar
  • 91
3 votes
1 answer
3k views

I have a Python (2.7.13) HTTP Server running in Debian, I want to stop any GET request that takes longer than 10 seconds, but can't find a solution anywhere. I already tried all the snippets posted ...
Urias BT's user avatar
  • 101
1 vote
0 answers
84 views

Can anyone tell me what's the solution for this? When I run it and load it from the browser... It's only loading and never displaying the "Hello Word!" text. But the text will appear in the browser ...
Angelo's user avatar
  • 43
0 votes
0 answers
213 views

I am trying to develop application which will have a Python Webserver. Everything works as expected, but after executing the logic(by using do_GET and do_POST methods) the server just stops and a ...
Noob's user avatar
  • 328
1 vote
1 answer
1k views

I'm having difficulties when parsing a raw HTTP request string and trying to confirm the calculated content-length value. The issue was found when parsing a POST request containing multipart data. In ...
Edmund Zy's user avatar
0 votes
0 answers
1k views

I currently have the below code which can be used as a demo. The code is set up to create a Tkinter window with a button. When the button is pushed it starts a HttpServer on the localhost. The issue ...
Grasume's user avatar
  • 116
0 votes
1 answer
161 views

I have built a tiny httpd using BaseHTTPRequestHandler in Python3. At the moment, it logs every HTTP GET request in systemd journal like this: Oct 18 23:41:51 ubuntu httpd.py[19414]: 192.168.0.17 - - ...
Martin's user avatar
  • 1,229
0 votes
1 answer
466 views

So basically, I am making an HTTP webhooks server in Python 3 and wanted to add a restart function because shell access is very limited on the server it will be running on. I found this snippet ...
Noah Cardoza's user avatar
0 votes
1 answer
129 views

I'm running an HTTP server written in python on my rasberry pi. The server takes images using a pi v2 camera module. I have set crontab to auto start my script 30 seconds past boot. The system ...
Alexander Källström's user avatar
1 vote
0 answers
86 views

def do_GET(self): logging.info("GET request,\nPath: %s\nHeaders:\n%s\n", str(self.path), str(self.headers)) self._set_response() params = parse_qs(urlparse(self.path).query) ...
Keyur's user avatar
  • 11
1 vote
2 answers
1k views

I have the following python code, where I have written a simple HTTP server by extending HTTPBaseServer: class ApiError(Exception): def __init__(self, code, msg=None, desc=None): self....
Anvith's user avatar
  • 517
-1 votes
2 answers
328 views

How do I get otherImages to return the string in it so that I can replace a word within it when called from 'narrow' method? def otherImages(self): self.wfile.write(bytes("<div id='...
Kade Williams's user avatar
-1 votes
1 answer
52 views

Is there way to change the word cat to dog in string() when calling it in main()? For example: def notimportant2("Not using this." def notimportant1("Not worried about this.") def string(): ...
Kade Williams's user avatar
0 votes
1 answer
1k views

I'm using the example bellow with Thread, a simple http server to listen to post request and collect the data for the main process. I want to convert it to use multiprocessing and passing a Queue in ...
Captain_Meow_Meow's user avatar
2 votes
1 answer
4k views

I have a custom BaseHTTPServer.BaseHTTPRequestHandler that can (partially) be seen below. It has a special method that allows me to assign a reply generator - a class that takes some data in (for ...
rbaleksandar's user avatar
  • 9,862
0 votes
1 answer
292 views

I currently have the following code: from BaseHTTPServer import BaseHTTPRequestHandler from pathlib import Path from random import randint import json import random example = 'logs/example.json' ...
ehime's user avatar
  • 8,535
0 votes
0 answers
99 views

I am using python's standard API (BaseHTTPServer.BaseHTTPRequestHander) as a backend for handling users' HTTP requests. Now, assuming on an average, the number of users on my website will be around ...
Vignesh A's user avatar
0 votes
1 answer
1k views

I want to develop a simple web server using python to handle some simple http request. I have learn how to response the request, such as transferring html pages or transferring some other file. When I ...
ceo1207's user avatar
0 votes
1 answer
3k views

I have faced an issue with a built-in python3 http.server module. Specifically, wfile.write() method in BaseHTTPRequestHandler class. I'm trying to send an html form pre-defined as a string to a ...
Vadim's user avatar
  • 1
14 votes
1 answer
26k views

I am simply trying to serve a PDF file from the http.server. Here is my code: from http.server import BaseHTTPRequestHandler, HTTPServer class MyServer(BaseHTTPRequestHandler): def do_GET(self):...
Clone's user avatar
  • 3,758
2 votes
0 answers
544 views

Overview of the problem I am running a webpage and an API written in python. The webpage sends some data to the python API in a POST request, which processes it and sends it back. The API works fine ...
Tom Davies's user avatar
0 votes
1 answer
2k views

I'm trying to implement a Python server supporting both HTTP and HTTPS based in BaseHTTPServer. This is my code: server_class = BaseHTTPServer.HTTPServer # Configure servers httpd = server_class(("0....
fgalan's user avatar
  • 12.4k
2 votes
2 answers
2k views

I've got a client and a server running on the same box. The client is able to issue urllib.request.Request() commands to external URLs and get responses back in about 0.1 seconds, fast enough that as ...
Dr. Cyanide's user avatar
0 votes
2 answers
1k views

I am trying to receive POST requests in Python using the BaseHTTPRequestHandler module. I wrote a simple HTML form: <html> <head> <meta charset='UTF-8'> </...
dblouis's user avatar
  • 608
0 votes
1 answer
538 views

I'm trying to write an HTTP server in python 2.7. I'm trying to use ready-made classes to simplify the job (such as SimpleHTTPServer, BaseHTTPRequestHandler, etc.). The server should listen for GET ...
Eran Zimmerman Gonen's user avatar
0 votes
1 answer
1k views

I am building a simple Python tool that takes GPS coordinates from an external receiver via COM port and translates it to a JSON string like is returned by Google Geolocation API. The purpose is to ...
najel's user avatar
  • 70
1 vote
0 answers
3k views

I am trying to implement a simple HTTP server with a form enabling the user to upload a file. I have got three code files: - A python script creating the webserver with BaseHTTPServer and ...
Baptiste's user avatar
2 votes
3 answers
13k views

I found this server online and I edited it a bit. Here is the code: from http.server import BaseHTTPRequestHandler, HTTPServer from xml.dom import minidom import os class MyHandler(...
G. Threepwood's user avatar
0 votes
1 answer
2k views

I have a special database class instance that i want passed into an HTTPServer handler so that I can have it returned for use in my do_GET and do_POST callback handlers. I tried subclassing to add my ...
user avatar
1 vote
0 answers
841 views

I'm trying to set up an HTTPS server using python, and SSL session caching doesn't work. Here's a minimal reproduction. The certificate is a simple self-signed certificate and key that I produced with ...
synp's user avatar
  • 91
-1 votes
1 answer
938 views

I use Python's BaseHTTPServer and implement the following very simple BaseHTTPRequestHandler: class WorkerHandler(BaseHTTPRequestHandler): def do_GET(self): self.wfile.write('{"status" : ...
SomethingSomething's user avatar
11 votes
3 answers
31k views

I have a Python class that inherits BaseHTTPRequestHandler and implements the method do_POST. I currently only succeed to respond with an integer status, e.g. 200, using the following command at the ...
SomethingSomething's user avatar
2 votes
0 answers
407 views

I am using javascript as client and a python as server. I need to send/receive in between them using protocol buffer. My proto looks like this : message CMsgBase { required CMsgHead msghead ...
supersuraccoon's user avatar
4 votes
3 answers
6k views

I have to pass a parameter to SimpleHTTPRequestHandler class, so I used class factory to create a custom handler as below. def RequestHandlerClass(application_path): class CustomHandler(...
user1429322's user avatar
  • 1,286
0 votes
1 answer
503 views

i have just rewritten my telegram bot from pyTelegramBotAPI with python-telegram-bot. There was an idea to have a monitoring url available publicly that we could ping once in a while with some app to ...
d56's user avatar
  • 843
5 votes
0 answers
1k views

I am trying to write a chrome extension which is able to send/receive data to/from a python server script. Currently, I am at the point where the js script is making a GET request okay, the only issue ...
Jamie's user avatar
  • 51
3 votes
1 answer
1k views

Python's BaseHTTPRequestHandler has an issue with forms sent through post! I have seen other people asking the same question (Why GET method is faster than POST?), but the time difference in my case ...
user34812's user avatar
  • 523