如何用curl重复https请求?

时间:2018-01-30 21:26:24

标签: ssl curl

我已捕获以下数据:

POST /AppHTTP.php HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 89
Host: parkingcab.mos.ru
Connection: Keep-Alive
Accept-Encoding: gzip
User-Agent: App: 4.6() / OS: 7.1.1 / Device: Sony

format=json&appVersion=3&phoneNo=79161234567&PIN=1234&operation=file_list&partnerID=Qulix

HTTP/1.1 200 OK
Date: Sat, 27 Jan 2018 09:57:26 GMT
Server: Apache
Cache-Control: max-age=2592000
Expires: Mon, 26 Feb 2018 09:57:26 GMT
Content-Length: 192
Connection: close
Content-Type: application/json; charset="utf-8"

{"status":1,"operation":"file_list","version":"2.6","response":{"files":[{"file":{"id":"2533922","name":"news.xml","time":"1516885837","type":"text\/xml","partner":"Qulix"}}],"language":"ru"}}

我尝试用curl重复 -

curl -vvvv --request POST --header "Content-Type: application/x-www-form-urlencoded" --header "User-Agent: App: 4.6() / OS: 7.1.1 / Device: Sony" --header "Host: pаrkingcаb.mоs.ru" --header "Connection: Keep-Alive" --header "Accept-Encoding: gzip" "https://pаrkingcаb.mоs.ru/AppHTTP.php?format=json&appVersion=3&phoneNo=79161234567&PIN=1234&operation=file_list&partnerID=Qulix" 

但我收到503 / No operation回复。我还试图将数据作为有效载荷传递:

curl -vvvv --request POST --header "Content-Type: application/x-www-form-urlencoded" --header "User-Agent: App: 4.6() / OS: 7.1.1 / Device: Sony" --header "Host: pаrkingcаb.mоs.ru" --header "Connection: Keep-Alive" --header "Accept-Encoding: gzip" -d "{'format': 'json', 'appVersion': '3', 'phoneNo': '79161234567', 'PIN': '1234',  'operation': 'file_list', 'partnerID': 'Qulix'}" "https://pаrkingcаb.mоs.ru/AppHTTP.php" 

但它没有帮助。我错过了什么?

1 个答案:

答案 0 :(得分:2)

你会喜欢h2c

如果您将HTTP请求粘贴到该请求中,它会为您提供此curl命令行:

curl --header Accept: --compressed --header "Connection: Keep-Alive" --user-agent "App: 4.6() / OS: 7.1.1 / Device: Sony" --data-binary "format=json&appVersion=3&phoneNo=79161234567&PIN=1234&operation=file_list&partnerID=Qulix" https://pаrkingcаb.mоs.ru/AppHTTP.php
相关问题