Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

HTTP requests parsed in 4 lines of Lua.

View gist:0fb5825c4268b988166e
1 2 3 4
local verb, resource, version, headers, body = data:match("(.+)%s+(.+)%s+(HTTP/%d%.?%d?)\r\n(.-)\r\n\r\n(.-)")
headers:gsub("(.-)%s*:%s*(.-)\r\n", function(name, value)
-- do something with name and value here
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.