Header has unallowed character % in value

For anyone wanting to get the % in through your request, just use the following code:

local function FixPercentage(Token)
	return Token:gsub("%%%x%x", function(match) 
		return string.char(tonumber(match:sub(2), 16)) 
	end)
end

local Token = FixPercentage("yourtokenwith%")
-- call requestasync function as normal

Found this piece of code from As8D. Something relating to hexadecimal code, not quite sure, but this allowed me to send a successful request to Twitter.

9 Likes