MCPcopy Index your code
hub / github.com/SunoAI-API/Suno-API / fetch

Function fetch

utils.py:20–36  ·  view source on GitHub ↗
(url, headers=None, data=None, method="POST")

Source from the content-addressed store, hash-verified

18
19
20async def fetch(url, headers=None, data=None, method="POST"):
21 if headers is None:
22 headers = {}
23 headers.update(COMMON_HEADERS)
24 if data is not None:
25 data = json.dumps(data)
26
27 print(data, method, headers, url)
28
29 async with aiohttp.ClientSession() as session:
30 try:
31 async with session.request(
32 method=method, url=url, data=data, headers=headers
33 ) as resp:
34 return await resp.json()
35 except Exception as e:
36 return f"An error occurred: {e}"
37
38
39async def get_feed(ids, token):

Callers 5

get_feedFunction · 0.85
generate_musicFunction · 0.85
generate_lyricsFunction · 0.85
get_lyricsFunction · 0.85
get_creditsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected