Commit 850b678981

850b678981f19fe9c9ab824f01fb3d1acb9999b2

parent: e657ad8188

Unsigned

Wraient <wraient.911@gmail.com> · 2024-10-21 14:54 UTC

Fix: Make request works

Layout: unified · split

internal/anilist.go +2 −1
@@ -197,7 +197,7 @@ func GetAnimeMalID(anilistMediaID int) (int, error) {
197197 return malID, nil
198198}
199199
200// Function to get AniList media ID and image
200// This function retrieves the MAL ID and cover image URL for an anime from AniList
201201func GetAnimeIDAndImage(anilistMediaID int) (int, string, error) {
202202 url := "https://graphql.anilist.co"
203203 query := `
@@ -391,6 +391,7 @@ func makePostRequest(url, query string, variables map[string]interface{}, header
391391 return nil, fmt.Errorf("failed to create request: %w", err)
392392 }
393393
394 req.Header.Set("Content-Type", "application/json") // <-- Important!
394395 for key, value := range headers {
395396 req.Header.Set(key, value)
396397 }