-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_api.http
More file actions
104 lines (80 loc) · 2.86 KB
/
test_api.http
File metadata and controls
104 lines (80 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
### ==========================================
### DEĞİŞKENLER (Sonlarında boşluk olmamalı!)
### ==========================================
@apiGateway = http://localhost:8000
@productId = 89fb3f84-1413-4dda-9682-ab678903a246
### ==========================================
### BÖLÜM 1: AUTH SERVİSİ
### ==========================================
### 1.1 Yeni Kullanıcı Kaydı
POST {{apiGateway}}/api/auth/register
Content-Type: application/json
{
"email": "admin@example.com",
"password": "password123"
}
### 1.2 Giriş Yap ve Token Al
# @name loginRequest
POST {{apiGateway}}/api/auth/login
Content-Type: application/json
{
"email": "admin@example.com",
"password": "password123"
}
### ==========================================
### BÖLÜM 2: PRODUCT SERVİSİ
### ==========================================
### 2.1 Yeni Ürün Ekle
POST {{apiGateway}}/api/products
Authorization: Bearer {{loginRequest.response.body.token}}
Content-Type: application/json
{
"name": "Mekanik Oyuncu Klavyesi",
"price": 1500.00,
"category": "Elektronik",
"stock": 50
}
### 2.2 Tüm Ürünleri Listele
GET {{apiGateway}}/api/products
Authorization: Bearer {{loginRequest.response.body.token}}
### 2.3 Tek Bir Ürün Getir
GET {{apiGateway}}/api/products/{{productId}}
Authorization: Bearer {{loginRequest.response.body.token}}
### 2.4 Ürün Güncelle
PUT {{apiGateway}}/api/products/{{productId}}
Authorization: Bearer {{loginRequest.response.body.token}}
Content-Type: application/json
{
"name": "Mekanik Oyuncu Klavyesi - RGB",
"price": 1750.00,
"category": "Elektronik",
"stock": 45
}
### 2.5 Ürün Sil
DELETE {{apiGateway}}/api/products/{{productId}}
Authorization: Bearer {{loginRequest.response.body.token}}
### ==========================================
### BÖLÜM 3: USER SERVİSİ
### ==========================================
### 3.1 Kendi Profilimi Getir
GET {{apiGateway}}/api/users/me
Authorization: Bearer {{loginRequest.response.body.token}}
### 3.2 Profilimi Güncelle
PUT {{apiGateway}}/api/users/me
Authorization: Bearer {{loginRequest.response.body.token}}
Content-Type: application/json
{
"username": "boransert",
"full_name": "Boran Sert",
"bio": "API Gateway Gelistiricisi"
}
### ==========================================
### HATA TESPİT (DEBUG) BÖLÜMÜ - GATEWAY BYPASS
### ==========================================
### TEST 2: Product Servisi Gerçekte Nerede?
GET http://localhost:8003/products
### TEST 3: Auth Servisi Validate İşlemi Çalışıyor Mu?
# Dikkat: Yukarıdan aldığın geçerli token'ı buraya yapıştır
POST http://localhost:8001/auth/validate
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbkBleGFtcGxlLmNvbSIsInVzZXJfaWQiOiI0MGZjYTFjMy00ZGRmLTRiMzItYTY0ZS02ZmY0N2E3ZjM1MmYiLCJyb2xlIjoiYWRtaW4iLCJleHAiOjE3NzU0MTQ3MjB9.fJQv6S16SIUxFEUJtC9FKyCTlira0EEn0qGRXUhK6pk
Content-Type: application/json