Created
June 16, 2021 21:36
-
-
Save cbfrance/cdb547897e56b143ab6ab41a8eebae85 to your computer and use it in GitHub Desktop.
http csrf with httpie
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
# Get csrf token from header | |
# shell function, add to .zshrc | |
# Requires httpie: brew install httpie | |
function httpl() { | |
csrf=`http $1 -h | grep -Po '(?<=csrftoken=)[^;]*(?=;)'` | |
http -f POST $* X-CsrfToken:$csrf | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment