When I send a post request in python...how do I
Have a "check"?
开发者_开发问答For example... I would have a dictionary with the parameters to sent to the POST.
params = {'text':'how are you?', 'subject':'hi'}
then I would have
opener.open('theurl',urllib.urlencode(params))
The question is...those parameters work well with text-boxes, since I just put the value in there. How about radio buttons? How do I signify which is "checked"?
Radio buttons has values too
<input type="radio" name="music" value="Rock" checked="checked"> Rock<br>
<input type="radio" name="music" value="Pop"> Pop<br>
<input type="radio" name="music" value="Metal"> Metal<br>
for that case {"music":"Rock"} in params
精彩评论