Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
웹 API 요청 질문 관련 (2015-07-19)
# coding: utf-8
"""
https://www.facebook.com/bigpython
"""
import requests
response = requests.get('http://api.openhangul.com/dic', {'api_key':20141107174448, 'q':u'좋다'})
# content-length
cLen = response.headers['Content-Length']
# Get the content of the HTTP response
content = response.content.decode('utf-8').strip()
print(cLen)
print(content)
@lseongjoo

This comment has been minimized.

Copy link
Owner Author

@lseongjoo lseongjoo commented Jul 19, 2015

HTTP 요청 시, requests 패키지를 추천합니다.
http://docs.python-requests.org/en/latest/user/quickstart/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.