PostMan從Charles復(fù)制CURL出來(lái)的不能成功執(zhí)行
從Charles導(dǎo)出來(lái)的CURL數(shù)據(jù)仗谆,修改后導(dǎo)入PostMan執(zhí)行并不成功,如圖所示:
但是直接執(zhí)行該代碼在SHELL卻是成功的放坏!
問(wèn)題出現(xiàn)在哪里哮针?檢查了發(fā)現(xiàn)是代碼參數(shù)里面的字段被編碼了巩螃,怎么解決呢甚淡?
直接打開(kāi)Chrome大诸,然后用decodeURIComponent(代碼)
即可,例如
decodeURIComponent(`curl 'http://api.gifshow.com/rest/n/feed/hot?appver=5.11.1.750&did_gt=1536039663222&did=C7C4E156-7E68-42E7-A223-EF1DDA20892F&extId=b4e947c925be9624884ccd4c290233f2&c=a&ud=406159254&ver=5.11&sys=ios12.1&mod=iPhone10%2C3&net=%E4%B8%AD%E5%9B%BD%E8%81%94%E9%80%9A_5' -H 'Host: api.gifshow.com' -H 'X-REQUESTID: 1306738266' -H 'Accept: application/json' -H 'User-Agent: kwai-ios' -H 'Accept-Language: zh-Hans-CN;q=1' --data "__NStokensig=226dd3f2ac68ff24be93809824852a4afce71a2605b1277d3f6c0aa0798b1754&client_key=56c3713c&count=20&country_code=cn&id=17&language=zh-Hans-CN%3Bq%3D1&needInterestTag=0&pcursor=1&pv=false&refreshTimes=2&sig=f5a492715f5a00d625e97abe73e078de&source=1&token=322bfccaec274d769bb69be4a75a16e1-406159254&type=7" --compressed`)
拿到結(jié)果就直接重新導(dǎo)入到PostMan就OK了材诽!