Одна полезная библиотека и один полезный сервис
Curlify - преобразует запрос 💻 Python requests в curl команду
Установка:
pip install curlify
Пример:
import curlify
import requests
response = requests.get("http://google.ru")
print(curlify.to_curl(response.request))
# curl -X 'GET' -H 'Accept: */*' -H 'Accept-Encoding: gzip, deflate' -H 'Connection: keep-alive' -H 'User-Agent: python-requests/2.18.4' 'http://www.google.ru/'
print(curlify.to_curl(response.request, compressed=True))
# curl -X 'GET' -H 'Accept: */*' -H 'Accept-Encoding: gzip, deflate' -H 'Connection: keep-alive' -H 'User-Agent: python-requests/2.18.4' --compressed 'http://www.google.ru/'
Curlconverter - сделает наоборот, превратит вашу curl команду в код на множестве ЯП
curl "https://example.com/" -u "some_username:some_password"
$username = "some_username"
$password = ConvertTo-SecureString "some_password" -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential($username, $password)
$response = Invoke-RestMethod -Uri "https://example.com/" -Credential $credential -Authentication Basic
💻 Curlify
🔗 Curl to code
#curl #converter #curlify
✈️ Whitehat Lab 💬Chat

