chore: httpクライアントの整備

http-client.private.env.jsonを/api/v1/appsを実行した結果と以下の内容を合わせて作成することで使える
{
  "dev": {
    "client_id": "",
    "client_secret": "",
    "host": "localhost:8081"
  }
}
This commit is contained in:
usbharu 2024-08-26 13:34:20 +09:00
parent 456df222f2
commit 1115590ab2
Signed by: usbharu
GPG Key ID: 8CB1087135660B8D
2 changed files with 33 additions and 0 deletions

19
http-client.env.json Normal file
View File

@ -0,0 +1,19 @@
{
"dev": {
"name": "value",
"Security": {
"Auth": {
"auth-id": {
"Type": "OAuth2",
"Grant Type": "Authorization Code",
"Client ID": "{{client_id}}",
"Client Secret": "{{client_secret}}",
"Redirect URL": "https://example.com",
"Token URL": "http://{{host}}/oauth/token",
"Auth URL": "http://{{host}}/oauth/authorize",
"Scope": "write read"
}
}
}
}
}

14
mastodon-api.http Normal file
View File

@ -0,0 +1,14 @@
POST http://{{host}}/api/v1/apps
Accept: application/json
Content-Type: application/json
{
"client_name": "test-client",
"redirect_uris": "https://example.com",
"scopes": "write read"
}
###
GET http://{{host}}/api/v1/accounts/verify_credentials
Authorization: Bearer {{$auth.token("auth-id")}}