📅  最后修改于: 2022-03-11 14:58:31.437000             🧑  作者: Mango
from urllib2 import Request, urlopen
from urllib import urlencode, quote_plus
key = 'gIQmqloKO%2B9e8xRB3iSW6t9uW%2FKem822g4ELNU%2FdzkhOifcf5%2BnHj9damtop%2FCRAWlyyTlhk7W1F0Jm1GX9w%3D%3D'
url = 'http://apis.data.go.kr/B551182/pubReliefHospService/getpubReliefHospList'
queryParams = '?' + urlencode({ quote_plus('ServiceKey') : key, quote_plus('ServiceKey') : '-', quote_plus('pageNo') : '1', quote_plus('numOfRows') : '10', quote_plus('spclAdmTyCd') : 'A0' })
request = Request(url + queryParams)
request.get_method = lambda: 'GET'
response_body = urlopen(request).read()
print response_body