POSTMAN无法导入网站XHR POST请求

stszievb  于 2022-11-07  发布在  Postman
关注(0)|答案(1)|浏览(864)

直到最近,我还能很好地使用postman,但自从它的最新更新以来,我再也不能使用了。
如果我以cURL(bash)的形式从网站复制POST请求,我会得到以下结果:

curl 'https://spectate-web.888sport.es/spectate/betslip/betslipFetchData' \
  -H 'authority: spectate-web.888sport.es' \
  -H 'accept: */*' \
  -H 'accept-language: es-ES,es;q=0.9' \
  -H 'cache-control: max-age=0' \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundaryBfiA5TvRRorRMOGo' \
  -H 'cookie: 888Cookie=lang%3Des%26OSR%3D485697%26RefType%3DNoReferrer%26TestData%3D%7B%22orig-lp%22%3A%22https%3A%2F%2Fwww.888sport.es%2F%22%2C%22referrer%22%3A%22NULL%22%7D; _gid=GA1.2.995815426.1666996817; 888TestData=%7B%22orig-lp%22%3A%22https%3A%2F%2Fwww.888sport.es%2F%22%2C%22referrer%22%3A%22NULL%22%2C%22datecreated%22%3A%222022-10-28T22%3A40%3A16.792Z%22%7D; bbsess=kN4YjaaDCW-nJWa4OxHQIRCc364; lang=esp; anon_hash=7b00acc96faf5119781cc6693e88e1bf; spectate_session=4d88ffab-af5c-452a-b0b4-df46f129d8c4%3Aanon; odds_format=DECIMAL; _ga=GA1.2.688931953.1666996817; FPID=FPID2.2.Tj33ha0XQmoaNPw2I5C29pCS2NIxwFa9J8Oic4Mfvs4%3D.1666996817; OptanonAlertBoxClosed=2022-10-28T22:40:21.763Z; _gcl_au=1.1.68988761.1666996822; OptanonConsent=isGpcEnabled=0&datestamp=Sat+Oct+29+2022+00%3A40%3A21+GMT%2B0200+(hora+de+verano+de+Europa+central)&version=6.29.0&isIABGlobal=false&hosts=&consentId=9d994a59-6978-4ff7-b84c-165e3ba44024&interactionCount=1&landingPath=NotLandingPage&groups=C0001%3A1%2CC0002%3A1%2CC0003%3A1%2CC0004%3A1; FPLC=1jxuCIujpmMEA%2B8UtQq4s3DV2dlZAI1BmbBRUYq7XbKBcFDtuXvIo0dzxqGtFeFNPmaTRKmOWUveUdiDJe6FJlGavhhPc8K9cIkAhPKropkJIbGkzkicMBb9Efbj5g%3D%3D; FPAU=1.2.1718678257.1666996822; _fbp=fb.1.1666996823784.1844480782; _sp_srt_ses.7bad=*; _sp_srt_id.7bad=1643e122-62eb-42e4-8b86-c915ac6c026c.1666996824.1.1666996824.1666996824.d981301d-7471-408b-aba2-8a2956d27e63; mzzietknzr=2a2e16c60d6d6820d5f25ff1c0853a; _gat_UA-125725186-2=1; _ga_QFPLQJ4PLW=GS1.1.1666996818.1.1.1666997839.60.0.0' \
  -H 'newrelic: eyJ2IjpbMCwxXSwiZCI6eyJ0eSI6IkJyb3dzZXIiLCJhYyI6IjI1MDk2NzQiLCJhcCI6IjMwNzYyODM3IiwiaWQiOiIxMjc4OWM1MTc2ODU5ZjZlIiwidHIiOiJlNDg5YjA4OGUyYzIzZWMxMWQ5YjkxZTRmZjY3ZDc2MSIsInRpIjoxNjY2OTk3ODQ1MzkwfX0=' \
  -H 'origin: https://www.888sport.es' \
  -H 'referer: https://www.888sport.es/' \
  -H 'sec-ch-ua: "Chromium";v="106", "Google Chrome";v="106", "Not;A=Brand";v="99"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Windows"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-site' \
  -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36' \
  -H 'x-spectateclient-v: 1.12' \
  --data-raw $'------WebKitFormBoundaryBfiA5TvRRorRMOGo\r\nContent-Disposition: form-data; name="selectionDataForFetch"\r\n\r\n[{"id":"11411785409","is_scorecast":false,"is_cast_market":false,"is_any":false}]\r\n------WebKitFormBoundaryBfiA5TvRRorRMOGo\r\nContent-Disposition: form-data; name="allSelectionData"\r\n\r\n[{"stake":0,"each_way_selected":false,"free_bet_id":null,"sp_selected":false,"is_scorecast":false,"is_cast_market":false,"is_any":false,"survey_id":null,"recommended":false,"recommendation_location":"","bet_locate":"unknown_component","id":"11411785409"}]\r\n------WebKitFormBoundaryBfiA5TvRRorRMOGo\r\nContent-Disposition: form-data; name="extraData"\r\n\r\n{"channel":"WEB"}\r\n------WebKitFormBoundaryBfiA5TvRRorRMOGo--\r\n' \
  --compressed

它返回一个错误,因为“请检查curl字符串中是否有格式错误的url”。显然,如果你用\"替换",用"替换',你就可以导入请求。
另一个问题是,它是作为GET导入的。
但如果这样做,则加载POST请求时不会加载有效负载。
那么,我如何完成导入整个请求呢?为什么会发生这种情况呢?

f0brbegy

f0brbegy1#

你的一些标题有双引号,没有转义。
请尝试导入此;

curl -X POST "https://spectate-web.888sport.es/spectate/betslip/betslipFetchData"
 -H "authority: spectate-web.888sport.es"
 -H "accept: */*"
 -H "accept-language: es-ES,es;q=0.9"
 -H "cache-control: max-age=0"
 -H "content-type: multipart/form-data; boundary=----WebKitFormBoundaryBfiA5TvRRorRMOGo"
 -H "origin: https://www.888sport.es"
 -H "referer: https://www.888sport.es/"
 -H "sec-ch-ua: \"Chromium\";v=\"106\", \"Google Chrome\";v=\"106\", \"Not;A=Brand\";v=\"99\""
 -H "sec-ch-ua-mobile: ?0"
 -H "sec-ch-ua-platform: \"Windows\""
 -H "sec-fetch-dest: empty"
 -H "sec-fetch-mode: cors"
 -H "sec-fetch-site: same-site"
 -H "user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36"
 -H "x-spectateclient-v: 1.12" 
 -d "$------WebKitFormBoundaryBfiA5TvRRorRMOGornContent-Disposition: form-data; name=\"selectionDataForFetch\"rnrn[{\"id\":\"11411785409\",\"is_scorecast\":false,\"is_cast_market\":false,\"is_any\":false}]rn------WebKitFormBoundaryBfiA5TvRRorRMOGornContent-Disposition: form-data; name=\"allSelectionData\"rnrn[{\"stake\":0,\"each_way_selected\":false,\"free_bet_id\":null,\"sp_selected\":false,\"is_scorecast\":false,\"is_cast_market\":false,\"is_any\":false,\"survey_id\":null,\"recommended\":false,\"recommendation_location\":\"\",\"bet_locate\":\"unknown_component\",\"id\":\"11411785409\"}]rn------WebKitFormBoundaryBfiA5TvRRorRMOGornContent-Disposition: form-data; name=\"extraData\"rnrn{\"channel\":\"WEB\"}rn------WebKitFormBoundaryBfiA5TvRRorRMOGo--rn"

相关问题