Last active
November 21, 2017 18:34
-
-
Save diegorocha/eb2f3c026d4500c1eb52f62b088b193e to your computer and use it in GitHub Desktop.
Snippet útil para gerar um comando curl equivalente a um request feito com o módulo requests do python.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl = lambda r: "curl -i -X {method} -H {headers} -d '{data}' '{uri}'".format(method=r.request.method, headers=" -H ".join(['"{0}: {1}"'.format(k, v) for k, v in r.request.headers.items()]), data=r.request.body if r.request.body else '', uri=r.request.url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment