Timeline for answer to use Python urllib.urlopen to send data accurately by Amyth
Current License: CC BY-SA 3.0
Post Revisions
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 10, 2015 at 13:46 | vote | accept | zl2003cn | ||
| Jul 10, 2015 at 13:45 | vote | accept | zl2003cn | ||
| Jul 10, 2015 at 13:46 | |||||
| Jul 10, 2015 at 13:44 | comment | added | zl2003cn |
Thank you! It is wrong using a raw string to encode, I use a dict instead and I got a proper response. By the way, urllib.urlencode method actually replace by urllib.parse.urlencode in Python 3.4 :)
|
|
| Jul 10, 2015 at 11:28 | comment | added | Amyth |
Can you update your question with what data_for_verify.encode() method returns ?
|
|
| Jul 10, 2015 at 11:26 | comment | added | Amyth |
That is because of your data_to_verify.encode() methods result. Make sure the data you pass to urlencode method is a python dictionary and is not already encoded. See how I have passed data to urllib.urlencode method in the example above.
|
|
| Jul 10, 2015 at 11:25 | comment | added | zl2003cn |
Result comes like this GET /?b'rjsdcctrl?mac%3dfcaa14ec56f3%26ipv4%3d1681312010%26ipv61%3d0%26ipv62%3d0%26ipv63%3d0%26ipv64%3d0%26product%3d33554432%26mainver%3d67108864%26subver%3d1610612736 ' HTTP/1.1 It have a ?b at the beginning and surrounded by quote mark
|
|
| Jul 10, 2015 at 11:23 | history | answered | Amyth | CC BY-SA 3.0 |