![]() |
|
[Python] Error trying to connect to a web with httplib in python? - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Python] Error trying to connect to a web with httplib in python? (/showthread.php?tid=6009134) |
Error trying to connect to a web with httplib in python? - Avispon99 - Sep 18, 2019 I am trying to connect a python script with a simple website that I made in html and php to test through httplib. The python script for the connection is as follows: Code import http.client as htThe php document that receives the connection is as follows: Code $username = $_GET['usertext'];However, when I try the getresponse() of httplib.client I get the answer the following error: Code Undefined index: usertext in on line 4I know that the error is in the python script and not in the php document because when I connect from an HTML page entering the user and the password I get the Welcome message, but when I do it from the python script I get the error . Anyone here know what I am doing wrong? RE: Error trying to connect to a web with httplib in python? - magicparty - Sep 18, 2019 Why not just touch the url with your parameters hard coded into it? Code import requestsThat last part will print [200] by default if the request is successful but the requests library could grab all kinds of things like session cookies etc. |