Closed martibook closed 6 years ago
when I run
uncurl "curl -H 'PID: 20000079' -H 'MT: 4' -H 'DivideVersion: 1.0' -H 'SupPhone: Redmi Note 3' -H 'SupFirm: 5.0.2' -H 'IMEI: wx_app' -H 'IMSI: wx_app' -H 'SessionId: ' -H 'CUID: wx_app' -H 'ProtocolVersion: 1.0' -H 'Sign: 7876480679c3cfe9ec0f82da290f0e0e' -H 'Accept: /' -H 'BodyEncryptType: 0' -H 'User-Agent: Mozilla/5.0 (Linux; Android 6.0.1; OPPO R9s Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/67.0.3396.87 Mobile Safari/537.36 hap/1.0/oppo com.nearme.instant.platform/2.1.0beta1 com.felink.quickapp.reader/1.0.3 ({"packageName":"com.oppo.market","type":"other","extra":{}})' -H 'Content-Type: text/plain; charset=utf-8' -H 'Host: pandahomeios.ifjing.com' --data-binary '{"CateID":"508","PageIndex":1,"PageSize":30}' --compressed 'http://pandahomeios.ifjing.com/action.ashx/otheraction/9028'"
I got
requests.post("http://pandahomeios.ifjing.com/action.ashx/otheraction/9028", data='{CateID:508,PageIndex:1,PageSize:30}', headers={ "Accept": "/", "BodyEncryptType": "0", "CUID": "wx_app", "Content-Type": "text/plain; charset=utf-8", "DivideVersion": "1.0", "Host": "pandahomeios.ifjing.com", "IMEI": "wx_app", "IMSI": "wx_app", "MT": "4", "PID": "20000079", "ProtocolVersion": "1.0", "SessionId": "", "Sign": "7876480679c3cfe9ec0f82da290f0e0e", "SupFirm": "5.0.2", "SupPhone": "Redmi Note 3", "User-Agent": "Mozilla/5.0 (Linux; Android 6.0.1; OPPO R9s Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/67.0.3396.87 Mobile Safari/537.36 hap/1.0/oppo com.nearme.instant.platform/2.1.0beta1 com.felink.quickapp.reader/1.0.3 ({packageName:com.oppo.market,type:other,extra:{}})" }, cookies={}, )
I run it in jupyter notebook and I didn't get what I want.
then I try convert that curl command here https://curl.trillworks.com/
I got the following, and I run it in jupyter notebook I got what I want.
import requests
headers = { 'PID': '20000079', 'MT': '4', 'DivideVersion': '1.0', 'SupPhone': 'Redmi Note 3', 'SupFirm': '5.0.2', 'IMEI': 'wx_app', 'IMSI': 'wx_app', 'SessionId': '', 'CUID': 'wx_app', 'ProtocolVersion': '1.0', 'Sign': '7876480679c3cfe9ec0f82da290f0e0e', 'Accept': '/', 'BodyEncryptType': '0', 'User-Agent': 'Mozilla/5.0 (Linux; Android 6.0.1; OPPO R9s Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/67.0.3396.87 Mobile Safari/537.36 hap/1.0/oppo com.nearme.instant.platform/2.1.0beta1 com.felink.quickapp.reader/1.0.3 ({"packageName":"com.oppo.market","type":"other","extra":{}})', 'Content-Type': 'text/plain; charset=utf-8', 'Host': 'pandahomeios.ifjing.com', }
data = '{"CateID":"508","PageIndex":1,"PageSize":30}'
response = requests.post('http://pandahomeios.ifjing.com/action.ashx/otheraction/9028', headers=headers, data=data)
after comparing them I found
curl command: --data-binary '{"CateID":"508","PageIndex":1,"PageSize":30}' uncurl turns it into: data='{CateID:508,PageIndex:1,PageSize:30}' that website turns it into: data = '{"CateID":"508","PageIndex":1,"PageSize":30}'
is that a bug?
Yeah, that looks like a bug.
when I run
uncurl "curl -H 'PID: 20000079' -H 'MT: 4' -H 'DivideVersion: 1.0' -H 'SupPhone: Redmi Note 3' -H 'SupFirm: 5.0.2' -H 'IMEI: wx_app' -H 'IMSI: wx_app' -H 'SessionId: ' -H 'CUID: wx_app' -H 'ProtocolVersion: 1.0' -H 'Sign: 7876480679c3cfe9ec0f82da290f0e0e' -H 'Accept: /' -H 'BodyEncryptType: 0' -H 'User-Agent: Mozilla/5.0 (Linux; Android 6.0.1; OPPO R9s Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/67.0.3396.87 Mobile Safari/537.36 hap/1.0/oppo com.nearme.instant.platform/2.1.0beta1 com.felink.quickapp.reader/1.0.3 ({"packageName":"com.oppo.market","type":"other","extra":{}})' -H 'Content-Type: text/plain; charset=utf-8' -H 'Host: pandahomeios.ifjing.com' --data-binary '{"CateID":"508","PageIndex":1,"PageSize":30}' --compressed 'http://pandahomeios.ifjing.com/action.ashx/otheraction/9028'"
I got
requests.post("http://pandahomeios.ifjing.com/action.ashx/otheraction/9028", data='{CateID:508,PageIndex:1,PageSize:30}', headers={ "Accept": "/", "BodyEncryptType": "0", "CUID": "wx_app", "Content-Type": "text/plain; charset=utf-8", "DivideVersion": "1.0", "Host": "pandahomeios.ifjing.com", "IMEI": "wx_app", "IMSI": "wx_app", "MT": "4", "PID": "20000079", "ProtocolVersion": "1.0", "SessionId": "", "Sign": "7876480679c3cfe9ec0f82da290f0e0e", "SupFirm": "5.0.2", "SupPhone": "Redmi Note 3", "User-Agent": "Mozilla/5.0 (Linux; Android 6.0.1; OPPO R9s Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/67.0.3396.87 Mobile Safari/537.36 hap/1.0/oppo com.nearme.instant.platform/2.1.0beta1 com.felink.quickapp.reader/1.0.3 ({packageName:com.oppo.market,type:other,extra:{}})" }, cookies={}, )
I run it in jupyter notebook and I didn't get what I want.
then I try convert that curl command here https://curl.trillworks.com/
I got the following, and I run it in jupyter notebook I got what I want.
import requests
headers = { 'PID': '20000079', 'MT': '4', 'DivideVersion': '1.0', 'SupPhone': 'Redmi Note 3', 'SupFirm': '5.0.2', 'IMEI': 'wx_app', 'IMSI': 'wx_app', 'SessionId': '', 'CUID': 'wx_app', 'ProtocolVersion': '1.0', 'Sign': '7876480679c3cfe9ec0f82da290f0e0e', 'Accept': '/', 'BodyEncryptType': '0', 'User-Agent': 'Mozilla/5.0 (Linux; Android 6.0.1; OPPO R9s Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/67.0.3396.87 Mobile Safari/537.36 hap/1.0/oppo com.nearme.instant.platform/2.1.0beta1 com.felink.quickapp.reader/1.0.3 ({"packageName":"com.oppo.market","type":"other","extra":{}})', 'Content-Type': 'text/plain; charset=utf-8', 'Host': 'pandahomeios.ifjing.com', }
data = '{"CateID":"508","PageIndex":1,"PageSize":30}'
response = requests.post('http://pandahomeios.ifjing.com/action.ashx/otheraction/9028', headers=headers, data=data)
after comparing them I found
curl command: --data-binary '{"CateID":"508","PageIndex":1,"PageSize":30}' uncurl turns it into: data='{CateID:508,PageIndex:1,PageSize:30}' that website turns it into: data = '{"CateID":"508","PageIndex":1,"PageSize":30}'
is that a bug?