Header "Cookie" has unallowed character "|" in value

Hi, I’m trying to get the X-CSRF-TOKEN but I’m getting the following error: Header “Cookie” has unallowed character “|” in value

How could I fix this problem?

local module = {}
local options = {}
local HttpService = game:GetService("HttpService")

function module.getToken(Cookie)
	local response = HttpService:RequestAsync({
		Url = "https://auth.roproxy.com/v2/logout",
		Method = "POST",
		Headers = {
			["Cookie"] = Cookie
		}
	})
	if response.Success and response.Body then
		return HttpService:JSONDecode(response.Body)
	end
end

return module

Escape it by prefacing it with a backslash, i.e; \|.

1 Like

Hi, that fixed the error but now it throws another error:

{"errors":[{"code":0,"message":"Authorization has been denied for this request."}]}

You’ll need to use your cookie & X-CSRF token.

How do I get the X-CSRF token?

Various Roblox pages include it in their request headers too.

1 Like

sorry for the bump but where would I put this?