Http Service 404, But page exists

Hi,

I’m using the Http Service to send data to my website(Node.JS). To just make sure everything is working I’m not using any variables and all I return to the Roblox game it the request.query. However in the output I get the error:

23:25:54.067 HTTP 404 (Not Found) - Server - Script:17

Below is my Roblox code:

local HttpService = game:GetService("HttpService")
local url = "https://rope.bulkbrains.com/logdata"

local response = HttpService:PostAsync(url, "data=true")
print(response)

However if I head to the url: https://rope.bulkbrains.com/logdata?data=true you can see I get my request returned to me.

I don’t understand how Roblox possibly marks this as a 404 error?

Thanks in advance for any help :+1:.

I believe it is because you are not appending the “?” separator to the url before you add the data. So either add the “?” to the url value or the response data value “?data=true”

Tried placing the “?” in both locations but still recieveing 404 error

By the way if it helps here is some of the NodeJS code:

module.exports = function(app) {
    app.route("/logdata").get(logdata)
}

function logdata (request, response) {
    response.send(request.query)
}

You’re trying to POST to the API when it only supports GET.

Replace app.route("/logdata").get(logdata) with app.route("/logdata").post(logdata)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.