I'm having a problem with url encoding on a python project requests module.
These are the two different url encoded params that I got from wireshark packet
- 0900+%28%EB%8C%80%ED%95%9C%EB%AF%BC%EA%B5%AD+%ED%91%9C%EC%A4%80%EC%8B%9C%29
- 0900%20(%EB%8C%80%ED%95%9C%EB%AF%BC%EA%B5%AD%20%ED%91%9C%EC%A4%80%EC%8B%9C)
'1' is the python requests module encoded url and '2' is the url from web browser sent packet. When I decode both of them, it shows the same utf-8 text.
Seems like handling of blank space and parentheses is different between them. Is there a way I can change '1' to '2'?
Here are the codes I used to send request
_url = "http://something"
_headers = {
'Accept': 'text/javascript',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'ko-KR',
'Connection': 'keep-alive',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36',
'X-Requested-With': 'XMLHttpRequest'
}
_params = {
'action': 'log',
'datetime': '0900 (대한민국 표준시)'
}
# This is the request part
session = requests.Session()
res = session.get(_url, headers=_headers, params=_params)