python
- requests 모듈로 http call을 할 수 있다.
- django.http의 JsonResponse 모듈로 json 응답을 내려줄 수 있다.
import requests def getHttpCall(): url = "http://hello.com" headers = {} req = requests.get(url, headers=headers) return JsonResponse(req.json())
import requests
def getHttpCall():
url = "http://hello.com"
headers = {}
req = requests.get(url, headers=headers)
return JsonResponse(req.json())