Created
June 6, 2020 07:28
-
-
Save sae13/c1d382b8033de6d3df7ec86534038965 to your computer and use it in GitHub Desktop.
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
#alias login "curl 'http://devapp01.icico.net.ir/oauth/token' -s -H 'Authorization: Basic U2FsZXM6cGFzc3dvcmQ=' -H 'Content-Type: application/x-www-form-urlencoded' --data 'grant_type=password&username=saeb&password=password'|jq '.access_token'" | |
#alias auth2 "echo \"Authorization: Bearer \" ( string replace -a '\"' '' (login))" | |
function nicico | |
set login (curl 'http://devapp01.icico.net.ir/oauth/token' -s -H 'Authorization: Basic U2FsZXM6cGFzc3dvcmQ=' -H 'Content-Type: application/x-www-form-urlencoded' --data 'grant_type=password&username=saeb&password=password'|jq '.access_token') | |
set auth2 (echo "Authorization: Bearer " ( string replace -a '"' '' $login)) | |
# echo $login $auth2 | |
curl -s -H $auth2 $argv | |
end | |
~ | |
~ | |
~ | |
~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment