const url = 'http://myurl.com/postdata'
const data = {
'param[]': '5;10;2033;16;1',
'param[]': '||3.0|||||||1',
'param[]': 'hour',
'param[]': '1',
}
const result = await axios.post(url, data) //doesn't work.
Когда я нажимаю «raw» в данных формы, она выглядит так:
param%5B%5D=5%3B10%3B2033%3B16%3B1¶m%5B%5D=%7C%7C3.0%7C%7C%7C%7C%7C%7C%7C1¶m%5B%5D=hour¶m%5B%5D=1
Полная команда CURL:
curl 'https://www.mingli.info/ajax.php?m=calccimen&script=calculate' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-origin' -H 'Origin: https://www.mingli.info' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-US,en;q=0.9,es;q=0.8' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: text/plain, */*; q=0.01' -H 'Referer: https://www.mingli.info/cimencard/eyJ0aW1lIjoxNTcwNzE3MzIwLCJsbmciOiIiLCJsYXQiOiIiLCJ1dGMiOjAsImNvdW50cnljb2RlIjoiIiwiY2l0eSI6IiIsImlkIjoiIiwiZ2VvbmFtZWlkIjoiIiwiZ29vZ2xlX2lkIjoiIiwiY2l0eWlkIjoiIiwidHoiOiIiLCJ1YXV0byI6IjEiLCJhZGRvbiI6eyJwZXJpb2QiOiJob3VyIiwiZGVhbCI6MSwiZ2hvc3RfYnkiOjIsImN0eXBlIjoxLCJnaG9zdF92aWV3X21vZGUiOjEsImdob3N0X21vZGUiOjEsImVtcHR5IjowLCJzZXRMb2NhbFRpbWUiOjAsIlFNREpSb3RhdGUiOjAsIkhvdXJUeXBlcyI6MCwiY2FsY190eXBlIjoxfX0=' -H 'X-Requested-With: XMLHttpRequest' -H 'Cookie: MSID=7gpp7ps31q6cu0qilb9klpiui2' -H 'Connection: keep-alive' --data 'param%5B%5D=10%3B10%3B2019%3B17%3B22¶m%5B%5D=%7C%7C3.0%7C%7C%7C%7C%7C%7C%7C1¶m%5B%5D=hour¶m%5B%5D=1¶m%5B%5D=1¶m%5B%5D=1¶m%5B%5D=2¶m%5B%5D=0¶m%5B%5D=1¶m%5B%5D=0¶m%5B%5D=utf8¶m%5B%5D=1¶m%5B%5D=0¶m%5B%5D=utf8¶m%5B%5D=0' --compressed
Я вставил эту команду CURL в PostMan, но когда я это сделал, я получил результаты, отличные от webpage .