ARDownloadParamString

From Blue Mars Developer Guidebook

Jump to: navigation, search

This is an Avatar Reality Utilities function.

Code

function ARDownloadParamString(params)
   local str = "";
   for key,value in pairs(params) do
      if (str ~= "") then
	 str = str.."&"; -- separate params with &
      end
      str = str..ARURLEncode(key).."="..ARURLEncode(value);
   end
   return str;
end
function ARURLEncode(s)
   s = string.gsub(s, "([&=+%c])", function (c)
				      return string.format("%%%02X", string.byte(c))
				   end)
   s = string.gsub(s, " ", "+")
   return s
end
Problems with this wiki page? Contact us either by: Support Email or Support Ticket System

Blue Mars Guidebook Privacy Policy
Blue Mars Guidebook Community Guidelines

Personal tools