0

I have Python 2.7.9 running on a linux box. Now I need to start a http server to accept post requests with payloads (post body). However, due to some restriction, I cannot use pip to install some third party modules. Can I achieve this with Python out of the box?

condor126
  • 67
  • 1
  • 9
  • 1
    That is a very silly restriction. As viach points out you can definitely to it with standard-library modules, but you shouldn't expect it to be very efficient. – Daniel Roseman May 06 '16 at 07:58
  • Use [bottle](http://bottlepy.org/), the one file http server framework. – Daniel May 06 '16 at 08:26

1 Answers1

0

Yep, it could be done with BaseHTTPServer.BaseHTTPRequestHandler from Python standard library.

See https://stackoverflow.com/a/31393963/3070670, nice working example is described there.

Community
  • 1
  • 1
Viach Kakovskyi
  • 1,487
  • 1
  • 14
  • 21