프로젝트
GitHub에서 보기
ofw/curlify
소개
Python requests 요청 객체를 curl 명령어로 변환하는 라이브러리입니다.
개발 도구측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalCurlify - convert Python Requests request object to cURL command
Installation
pip install curlify
Changes
v3.0.0
- Remove Python 2 compatibility
- Add
prettyparameter to enable generating a multi-line command - Don't add
-Xwhen it's unnecessary - Correctly send empty headers
- Don't generate
--datathat would read a file - Don't sort headers, their order is deterministic on Python 3.7+
v2.2.0
- Fixed shell quotes. Fixed posting CSV file. Thanks to @leNEKO
v2.1.1
- Add
--insecureflag ifverifyparameter is notTrue
v2.1.0
- Fixed body rendering when using
jsonparam to request function.
v2.0.1
- Added
compressedparameter toto_curlfunction, if it is needed to add--compressedoption to generated cURL command.
v2.0
- Skip
-doption if request body is empty https://github.com/ofw/curlify/issues/6 - Minor changes to header sorting
v1.2
- Order of headers is deterministic (thanks to @tomviner)
Example
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/'
관련 프로젝트 살펴보기
불러오는 중…