Hi. Im currently scripting a Roblox Ranking Bot but the Http request always failes because the Headers are not a tabel. Can someone help me to fix it?
Can you show me the full script?
Do you mean from the Request function?
Can you show the code in the request function?
yep i mean that aaaaaaaaaaaaaaaaaa
wht headers is a table tho
I’m pretty sure you need table keys when creating the request table, you just listed the enums.
You need to specify the data when using RequestAsync
.
--example
local data = {
["Url"] = "", --some url
["Method"] = "POST",
["Headers"] = {
["content-type"] = "application/json"
},
["Body"] = HttpService:JSONEncode({
["content"] = "message"
})
}
--then, request with this data
local success, response = pcall(HttpService.RequestAsync, HttpService, data)
Could you also help me with this error?
If you used my code example I sent in my previous post, it’s because I forgot to include the success field returned from pcall
. I updated my previous post, please take a look.
If not, please send your new code.
You got error code 404, which indicates that the page wasn’t found on the server. Looking at the warning, it looks like you aren’t able to make a Http POST request to that webpage. Check the URL and data.
It looks like from your code you’re trying to retrieve something from the webpage, try using the GET method instead.