Python Forum
recive post request from client(browser) python sockets
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
recive post request from client(browser) python sockets
#1
i am writing a simple webserver without using any libraries in python i am trying to recive a post request from the browser

HTML FILE

Output:
<form method="POST"> <input type="text" /> <input type="submit" /> </form>
python file

request = client_connection.recv(1024)
print request
so if i type HELLO WORLD! in the input box and press submit i get this response

Output:
POST / HTTP/1.1 Host: 127.0.0.1:8888 Connection: keep-alive Content-Length: 0 Cache-Control: max-age=0 Origin: http://127.0.0.1:8888 Upgrade-Insecure-Requests: 1 Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 Referer: http://127.0.0.1:8888/ Accept-Encoding: gzip, deflate, br Accept-Language: en-US,en;q=0.9 Cookie: PHPSESSID=k2ae5h3v8esmiij1eu1mff7ju6; FAea2c25b156a4d770f5eb3b4a876d1c4a=n2nu253hf3bq8oduq4chvuk0i3
i can not find the word HELLO WORLD! anywhere

how can i read the post request in python

Stackoverflow-version
Reply
#2
the name tag was missing i fixed it
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Post Request containing username/password using python for jwt anna 1 3,804 Oct-18-2022, 04:06 PM
Last Post: anna
  Sockets interferring with USB ? epif18 0 2,602 Mar-19-2021, 07:45 PM
Last Post: epif18
  How can i create a server for already existing client using Python? Chapanson 21 7,316 Aug-19-2020, 09:12 AM
Last Post: DeaD_EyE
  Just learning sockets etc... floatingshed 2 2,293 May-06-2020, 09:37 PM
Last Post: floatingshed
  how can i send a list of tuples from the server to the client using sockets? dafdaf 1 3,830 Apr-13-2020, 10:51 PM
Last Post: Larz60+
  Python script multi client server sonra 1 2,428 Mar-24-2020, 03:49 PM
Last Post: Larz60+
  Quick sockets question... ptrivino 2 2,173 Sep-26-2019, 08:51 PM
Last Post: ptrivino
  Sockets and Sendmail taintedsushi 2 2,304 Sep-02-2019, 12:51 PM
Last Post: venquessa
  Python server(Django web site)/client(Python app) connection Junior_Pythoneer 5 3,755 Jul-05-2019, 05:41 PM
Last Post: noisefloor
  Script Conversion 2.7 to 3 (sockets) Pumpernickel 1 2,512 Apr-10-2019, 04:26 PM
Last Post: Pumpernickel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020