Hi, I’m currently working on a catalog searching system that allows players to select a category, sub category, keyword etc. Since all of that is being handled on the client I use a remove event to fire a function in a Catalog module (using the External Catalog API) I’ve made to search for catalog with the current parameters (passed from the client, now on server) and return the result.
Module Function
function module.Search(category,sub ,Keyword, Limit, cursor)
print(category)
local url = "https://catalog.roproxy.com/v1/search/items/details?Category="..tostring(category).."&Subcategory="..tostring(sub).."&Keyword="..tostring(Keyword).."&Limit="..tostring(Limit)
if cursor then
url = url .. "&Cursor="..tostring(cursor)
end
local response = HTTPService:GetAsync(url)
local decode = HTTPService:JSONDecode(response)
return decode
end
Server Catching Remove Event
game.ReplicatedStorage.Events:WaitForChild("SearchCatalog").OnServerEvent:Connect(function(player, c, s, k, l, cursor)
Catalog.Search(c, s, k, l, cursor)
end)
Client Calling the event
----Catalog Searching----
local event = game.ReplicatedStorage.Events:WaitForChild("SearchCatalog")
--Catagory, sub, keyword, limit, cursor
event:FireServer(1,54,"meme",30, nil)
Although I’m receiving the HTTP 400 (Bad Request) error, I’ve tried replacing the parameters when calling the function (on the server) with pre-set ones that are not being passed from the client and everything works fine. My theory right now is that HTTP service does not accept values from the client, although I’m unsure of a work around.