Bottom Page

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
buran wrote Dec-13-2018, 08:21 AM:
Please, use proper tags when post code, traceback, output, etc.
See BBcode help for more info.
Quote
#2
the name tag was missing i fixed it
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Python server(Django web site)/client(Python app) connection Junior_Pythoneer 5 413 Jul-05-2019, 05:41 PM
Last Post: noisefloor
  Simple send and recive string Server/Client Epilepsy 1 1,097 May-01-2018, 08:17 PM
Last Post: ThiefOfTime
  Python 2.7 RAW sockets: missing and wrong fields in ARP header gold604 1 1,263 Feb-04-2018, 07:10 PM
Last Post: wavic

Forum Jump:


Users browsing this thread: 1 Guest(s)