Post method in Python using requests

I have simple form which accepts text and calls a php file abc.php through post method:\[code\]<form method='post' action="abc.php"><input type="textarea" name="text"><input type="submit"></form>\[/code\]contents of abc.php\[code\]<?php$msg=$_POST["text"];print $msg;?>\[/code\]I wrote a python script for posting messages using requests library as follows:\[code\]import requestskeys={'text':'lol rofl'}r=requests.post("http://127.0.0.1/abc.php/POST",params=keys)print r.urlprint r.text\[/code\]I was getting the following output(error):\[code\] http://localhost/abc.php/POST?text=lol+rofl<b>notice</b>:undefined index;text in C:/xampp/htdocs/abc.php on line 2\[/code\]note:form and abc.php works perfectly when run from the browser
 
Back
Top