Questions tagged [basehttpserver]

This Python class is used to make a simple HTTP web server.

Related links

126 questions
0
votes
0 answers

Scalability of python's BaseHTTPHandler?

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 150, will it be safe to stick with this python's…
Vignesh A
  • 11
  • 4
0
votes
1 answer

a web server developed by python, how to transfer a image file, and can show in a web browser?

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 transfer a image file, a client use a browser to…
0
votes
1 answer

python3 HTTPServer/BaseHTTPRequestHandler output stream issue

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 client with a GET request. The output stream to the…
0
votes
1 answer

Dual HTTP and HTTPS Python server based on BaseHTTPServer not working as expected

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.0.0.0", 1044), MyHandler) httpsd =…
fgalan
  • 11,732
  • 9
  • 46
  • 89
0
votes
2 answers

Empty POST request from HTML form (Python)

I am trying to receive POST requests in Python using the BaseHTTPRequestHandler module. I wrote a simple HTML form:
dblouis
  • 568
  • 1
  • 5
  • 18
0
votes
1 answer

Writing an HTTP serrver with context in python

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 requests, and once it gets one - parse the request…
Eran Zimmerman Gonen
  • 4,375
  • 1
  • 19
  • 31
0
votes
1 answer

BaseHTTPServer POST request - Connection Reset

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 replace the Google Geolocation provider URL in…
0
votes
1 answer

How to get HTTPServer to pass my own class back with do_GET's?

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 database class as an additional argument to the…
user4805123
0
votes
0 answers

SSL session cache fails in python 2.7

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 the openssl command-line. from BaseHTTPServer…
synp
  • 61
  • 2
0
votes
1 answer

Add custom request mapping in python-telegram-bot embedded HTTPServer.HTTPServer

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 see if the bot is still running (internally, it…
d56
  • 825
  • 1
  • 9
  • 26
0
votes
1 answer

Python - BaseHTTPServer - Overriding "handle_timeout" method

I'm currently working with Python's BaseHTTPServer and I need to override the handle_timeout() method of the server. According to Python's documentation (https://docs.python.org/2/library/basehttpserver.html), BaseHTTPServer is a subclass of…
Nathol
  • 29
  • 6
0
votes
0 answers

Cannot redirect to index.html page after signing in

My client app first takes user_ID and password from login.html page and then as "Sign In" button is pressed, a function "display()" runs that stored ID and password from input fields and sends it to Server. the server approves the login ID and…
Anum Sheraz
  • 2,383
  • 1
  • 29
  • 54
0
votes
1 answer

Proper way to process html form in BaseHTTPHandler

I know that I am supposed to use cgi.FieldStorage for that. But what do I initialize it with? def do_GET(self): form = cgi.FieldStorage(WHAT SHOULD BE HERE?!) thanks! I did search, but didn't find an answer :(
Evgeny
  • 3,064
  • 2
  • 18
  • 19
0
votes
1 answer

How to measure RTT using python httplib, Httpserver

I made an HTTP proxy using the httplib and BaseHTTPServer, Now I want to know if there is way that I can calculate the RTT to each server. I don't want to use ping method because I want to calculate the RTT for each object's server passing through…
0
votes
1 answer

BaseHTTPServer only Serves Webpage Once

I'm trying to figure out how to set up a basic web server in Python, but I'm having a lot of difficulty. My main issue is that I am only able to get my server to serve the webpage once. The html displays a message in the browser and the Javascript…
Andrew Kline
  • 115
  • 1
  • 6
1 2 3
8 9