Reputation: 11
I am looking to use python in order to post data to a website form. the website is http://up-to-no-good.appspot.com I know that I need to use post, but I do not know how to get it to actually post. The sample input I would like to send (using the requests module) is:
map : arena_lumberyard at: 0 x, 0 y, 0 z
players : 21 (33 max)
# userid name uniqueid connected ping loss state
# 88 "gza" STEAM_0:0:31273869 30:33 70 0 active
# 75 "MasterDovahBeard" STEAM_0:1:41046299 46:08 120 0 active
# 101 "Gigs" STEAM_0:0:17483483 04:40 78 0 active
Upvotes: 0
Views: 235
Reputation: 671
here is an example: requests doc - POST request
you need to create a dictionary with the key/value data and pass it to requests.post()
POST_DATA = {'user_id': 88
,'name' : "gza"
# ...
}
content = requests.post('http://example.com/', data=POST_DATA).content
Upvotes: 0