Skip to content

Instantly share code, notes, and snippets.

@littmus
Last active November 3, 2015 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save littmus/9625a4436e1edfb3afe9 to your computer and use it in GitHub Desktop.
Save littmus/9625a4436e1edfb3afe9 to your computer and use it in GitHub Desktop.
try:
import httplib
except:
import http.client as httplib
try:
import urllib
urllib.urlencode({})
except:
import urllib.parse as urllib
p = urllib.urlencode({'user_id':'blahsdfi','password':'qwera'})
h = {
'Content-Type':'application/x-www-form-urlencoded',
'User-Agent':'Mozilla/5.0 (Linux; Android 4.2.2; GT-I9505 Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.59 Mobile Safari/537.36'
}
conn = httplib.HTTPConnection("www.koreapas.com")
conn.request("POST", "/bbs/login_check.php", p, h)
r = conn.getresponse()
try:
print(r.msg.as_bytes())
except:
print(r.msg)
print(r.getheaders())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment