I’m converting a Spotify to Roblox integration to work outside of Studio but I’m having problems with using Get requests on the Spotify API. Sending any Get request yields infinitely and never gets a response, but Put and Post requests both work fine. I only get a response if the OAuth token is wrong, which gives me 401 as it should.
This is what I’m using to send requests, Post and Put requests work fine with this.
local Body = ""
local res
if method == "GET" then Body = nil end
local res = httpService:RequestAsync({
Url = "https://api.spotify.com/v1/me/player/"..URL,
Method = method,
Headers = {
["Accept"] = "application/json",
["Authorization"] = "Bearer "..Token,
["Content-Type"] = "application/json"
},
Body = Body,
})
--doesn't get to part if sending a Get request
print(res.StatusCode,res.Success,res.StatusMessage,res.Headers,res.Body)
I assume what’s happening is it’s yielding and waiting for a response, but it’s just not getting one. One thing I know for sure is that Spotify requires you to set the Body of your request to an EMPTY STRING for requests that don’t use it, which Roblox doesn’t allow you to do for Get requests, and now what I’m wondering is if it’s because of that? Is there any way around this? Thanks.