PostMan从Charles复制CURL出来的不能成功执行
从Charles导出来的CURL数据,修改后导入PostMan执行并不成功,如图所示:
image-20181220002055015但是直接执行该代码在SHELL却是成功的!
image-20181220002149168问题出现在哪里?检查了发现是代码参数里面的字段被编码了,怎么解决呢?
直接打开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`)
拿到结果就直接重新导入到PostMan就OK了!
网友评论