[英]curl POST and GET response
我正在嘗試編寫一個簡單的單行代碼,該文件將帶有.crt並將其作為SSLShopper.com傳遞給CRT檢查器。 我可以發布數據,但是我得到的只是標題和HTTP響應。 他們網站上的表單看起來很簡單,只需一個AJAX調用即可返回結果。 這是我到目前為止的內容:
curl -L -i -X POST -k "https://www.sslshopper.com/assets/snippets/sslshopper/ajax/ajax_decode.php" --data-binary @test.crt
是否可以同時進行POST和GET?
似乎您需要使用以下參數以表單網址編碼格式發送數據:
cert_text={CERT_CONTENT}
decode_type=certificate
您還需要X-Requested-With: XMLHttpRequest
和Connection: keep-alive
標頭:
cert_content=$(cat test.crt)
curl 'https://www.sslshopper.com/assets/snippets/sslshopper/ajax/ajax_decode.php' \
-H 'X-Requested-With: XMLHttpRequest' \
-H 'Connection: keep-alive' \
--data-urlencode "cert_text=$cert_content" \
--data-urlencode "decode_type=certificate"
但是對於此任務,您無需調用某些端點即可檢查證書,如https://www.sslshopper.com/certificate-decoder.html中所指定,您可以直接使用openssl :
openssl x509 -in test.crt -noout -subject -enddate -startdate -issuer -serial
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.