<OpenAPI_ServiceResponse> <cmmMsgHeader> <errMsg>SERVICE ERROR</errMsg> <returnAuthMsg>SERVICE_ACCESS_DENIED_ERROR</returnAuthMsg> <returnReasonCode>20</returnReasonCode> </cmmMsgHeader> </OpenAPI_ServiceResponse> code example
Example: SERVICE ERROR SERVICE_ACCESS_DENIED_ERROR 20
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