Skip to content

Instantly share code, notes, and snippets.

Created March 15, 2016 00:19
What would you like to do?
파이썬에서 query, header 추가해서 urlopen 사용하기
import urllib.parse
import urllib.request
url = ''
values = {'name': 'nesffer',
'query': 'python'}
headers = {'Content-Type': 'text/plain'}
data = urllib.parse.urlencode(values).encode('utf-8')
req = urllib.request.Request(url, data, headers)
f = urllib.request.urlopen(req)
Copy link

감사합니다 덕분에 해결했슴당

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment