Skip to content

Instantly share code, notes, and snippets.

@chemar
Created July 3, 2018 18:30
Show Gist options
  • Save chemar/8ed79c1f851231457f27946487a41f06 to your computer and use it in GitHub Desktop.
Save chemar/8ed79c1f851231457f27946487a41f06 to your computer and use it in GitHub Desktop.
Quoted strings with variables
-- Ran into a bit of trouble sending quoted string payload to a REST API
--
-- Working examples of quoted strings with variables provided for reference
--
--> print('"'..u..'"')
--"myuser"
--> print('{ "username":"'..u..'" }')
--{ "username":"myuser" }
--> payload = '{ "username":"'..u..'", "password":"'..p..'" }'
--> print(payload)
--{ "username":"myuser", "password":"mypassword" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment