Created
July 3, 2018 18:30
-
-
Save chemar/8ed79c1f851231457f27946487a41f06 to your computer and use it in GitHub Desktop.
Quoted strings with variables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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