django rest framework 쓰는데
views.py 에서
request.data['example']
요렇게 Post data 받아오면 전부 str 형식이던데 원래이럼??
example = ['a','b','c']
post_data = urllib.parse.urlencode({'example':example}).encode('uft-8')
url = 'http://127.0.0.1:8000/example/'
req = urllib.request.Request(url,post_data)
result = urllib.request.urlopen(req).read().decode('utf-8')
이렇게 보내고 받아보면 리스트가 전부 str로 변해있더라고
무조건 str로 변해서 오는건가??
원래 http는 plaintext야
http 로 보내는 데이터는 전부 string 으로 변환되는거야??
그래~~~~ 보통 middleware 로 지원할테니까 이런거 찾아봐라
https://opentutorials.org/module/4034/25092
오 땡큐
urlencode를 하면 당연히 string으로 변환해서 받지 이사람아