スキル一覧に戻る
DerGueni

api-tester

by DerGueni

HTML Formular Bearbeitung

0🍴 0📅 2026年1月22日
GitHubで見るManusで実行

SKILL.md


name: API Tester description: Testet REST API Endpoints, validiert Responses, prüft Erreichbarkeit when_to_use: API testen, Endpoint prüfen, Response validieren, Server erreichbar, curl Test version: 1.0.0

API Tester

Schnell-Tests

PowerShell/CMD

# GET Request
curl http://localhost:5000/api/health

# POST Request
curl -X POST -H "Content-Type: application/json" -d "{\"name\":\"Test\"}" http://localhost:5000/api/data

# Alle Routen auflisten
curl http://localhost:5000/api/routes

Browser Console (F12)

// GET
fetch('http://localhost:5000/api/health')
    .then(r => r.json())
    .then(console.log);

// POST
fetch('http://localhost:5000/api/data', {
    method: 'POST',
    headers: {'Content-Type': 'application/json'},
    body: JSON.stringify({name: 'Test'})
})
.then(r => r.json())
.then(console.log);

Response-Codes prüfen

CodeBedeutungAktion
200OK✓ Alles gut
201Created✓ Ressource erstellt
400Bad RequestRequest-Body prüfen
404Not FoundURL/Route prüfen
405Method Not AllowedGET/POST richtig?
500Server ErrorServer-Logs prüfen

Test-Checkliste

Vor dem Test

  • Server läuft (python api_server.py)
  • Richtiger Port (default: 5000)
  • CORS aktiviert

Während Test

  • Status-Code prüfen
  • Response-Body prüfen
  • Content-Type: application/json
  • Keine CORS-Fehler

Nach Test

  • Erwartete Daten erhalten
  • Format korrekt
  • Keine Fehler in Server-Console

Endpoint-Dokumentation Template

## GET /api/mitarbeiter

Gibt Liste aller Mitarbeiter zurück.

**Request:**
- Method: GET
- URL: http://localhost:5000/api/mitarbeiter

**Response (200 OK):**
```json
{
    "status": "ok",
    "data": [
        {"id": 1, "name": "Max Mustermann"},
        {"id": 2, "name": "Erika Musterfrau"}
    ]
}

Fehler:

  • 404: Keine Mitarbeiter gefunden
  • 500: Datenbankfehler

## Python Test-Script

```python
import requests

BASE_URL = 'http://localhost:5000'

def test_health():
    r = requests.get(f'{BASE_URL}/api/health')
    assert r.status_code == 200
    print('✓ Health Check OK')

def test_get_data():
    r = requests.get(f'{BASE_URL}/api/data')
    assert r.status_code == 200
    assert 'data' in r.json()
    print('✓ GET Data OK')

def test_post_data():
    r = requests.post(
        f'{BASE_URL}/api/data',
        json={'name': 'Test'},
        headers={'Content-Type': 'application/json'}
    )
    assert r.status_code in [200, 201]
    print('✓ POST Data OK')

if __name__ == '__main__':
    test_health()
    test_get_data()
    test_post_data()
    print('\n✓✓✓ Alle Tests bestanden!')

Batch-Test (Windows)

@echo off
echo Testing API Endpoints...
echo.

echo [1] Health Check
curl -s http://localhost:5000/api/health
echo.

echo [2] Get Routes
curl -s http://localhost:5000/api/routes
echo.

echo [3] Test POST
curl -s -X POST -H "Content-Type: application/json" -d "{\"test\":true}" http://localhost:5000/api/test
echo.

echo Done!
pause

Dateipfade

  • API Server: 06_Server/api_server.py
  • Test-Scripts: 06_Server/tests/

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です