This commit is contained in:
cangui 2025-06-19 20:19:13 +02:00
parent f123e928c2
commit 5cf0344b23

View File

@ -319,6 +319,11 @@ func (c *Client) doJSON(ctx context.Context, method, path string, params url.Val
return err return err
} }
reqBody = bytes.NewReader(b) reqBody = bytes.NewReader(b)
// 👇 DEBUG : afficher le body
log.Printf("➡️ [API %s] URL: %s\nBody: %s\n", method, urlStr, string(b))
} else {
log.Printf("➡️ [API %s] URL: %s (empty body)", method, urlStr)
} }
req, err := http.NewRequestWithContext(ctx, method, urlStr, reqBody) req, err := http.NewRequestWithContext(ctx, method, urlStr, reqBody)
@ -326,7 +331,11 @@ func (c *Client) doJSON(ctx context.Context, method, path string, params url.Val
return err return err
} }
req.Header.Set("Authorization", "Bearer "+c.account.AccessToken) // 👇 DEBUG : afficher le header Authorization
authHeader := "Bearer " + c.account.AccessToken
log.Printf("➡️ Authorization Header: %s\n", authHeader)
req.Header.Set("Authorization", authHeader)
req.Header.Set("Content-Type", "application/json") req.Header.Set("Content-Type", "application/json")
resp, err := c.http.Do(req) resp, err := c.http.Do(req)
@ -346,6 +355,7 @@ func (c *Client) doJSON(ctx context.Context, method, path string, params url.Val
return nil return nil
} }
// =========================== RSS =========================== // =========================== RSS ===========================
type RSSFeed struct { type RSSFeed struct {
ID string `json:"id" gorm:"column:id;primaryKey"` ID string `json:"id" gorm:"column:id;primaryKey"`