AWS Auth v2 plugin for HTTPie
HTTPie で AWS Signature v2 の認証をリクエストに付加するための Auth plugin です。
pip install --upgrade git+https://github.com/kzmake/httpie-aws-authv2
export ACCESS_KEY_ID={払い出されたACCESS_KEY_ID}
export SECRET_ACCESS_KEY={払い出されたSECRET_ACCESS_KEY}
set -gx ACCESS_KEY_ID {払い出されたACCESS_KEY_ID}
set -gx SECRET_ACCESS_KEY {払い出されたSECRET_ACCESS_KEY}
で ACCESS_KEY_ID / SECRET_ACCESS_KEY を設定後、リクエストする
http -v -A aws2 -a {払い出されたACCESS_KEY_ID}:{払い出されたSECRET_ACCESS_KEY} GET https://example.com/api/ Action==DescribeInstances
上記のコマンドのように -a {払い出されたACCESS_KEY_ID}:{払い出されたSECRET_ACCESS_KEY}
を追加してリクエストする
-A aws2
を HTTPie に追加し、リクエスト
Query (Action==DescribeInstances InstanceId.1==i-HOGEHOGE
) を指定してリクエスト
http -v -A aws2 GET https://example.com/api/ Action==DescribeInstances InstanceId.1==i-HOGEHOGE
Formオプション(-f
) を指定し、 Form data (Action=DescribeInstances InstanceId.1=i-HOGEHOGE
) を指定してリクエスト
http -v -f -A aws2 POST https://example.com/api/ Action=DescribeInstances InstanceId.1=i-HOGEHOGE
raw-payload(echo "Action=DescribeInstances&InstanceId.1=i-HOGEHOGE"
) をパイプで渡してリクエスト
echo "Action=DescribeInstances&InstanceId.1=i-HOGEHOGE" | http -v -f -A aws2 POST https://example.com/api/