speedygonzalez
asked on
Create a JSON Clear Text String for a set of data.
Hello,
I need to create a JSON Clear Text String from a set of data I have. I will then encrypt this string & pass it to a 3rd party in a URL.
Can I just create a string formatted to how JSON would be formatted, or do I need to create an actual JSON object (Note I don;t need the string myself after it is created & encrypted & sent via the url.I Presume I can just construct a string without a need for an actual JSONObject)?
if Creating a string. Is the following a good example of how it should be created/formatted?
String jsonReturn='{email' + ':' + ' jim.secondname@test.com}';
jsonReturn = jsonReturn + '{user_type' + ':' + ' Sales Rep}';
jsonReturn = jsonReturn + '{first_name' + ':' + ' Jim}';
jsonReturn = jsonReturn + '{zip' + ':' + ' 12456}';
Therefore: email, user_type, first_name and zip are my four names and the values follow (e.g. jim.secondname@test.com is a value.
Does the above look like a correct JSON Clear Text String being created?
Thanks in advance.
I need to create a JSON Clear Text String from a set of data I have. I will then encrypt this string & pass it to a 3rd party in a URL.
Can I just create a string formatted to how JSON would be formatted, or do I need to create an actual JSON object (Note I don;t need the string myself after it is created & encrypted & sent via the url.I Presume I can just construct a string without a need for an actual JSONObject)?
if Creating a string. Is the following a good example of how it should be created/formatted?
String jsonReturn='{email' + ':' + ' jim.secondname@test.com}';
jsonReturn = jsonReturn + '{user_type' + ':' + ' Sales Rep}';
jsonReturn = jsonReturn + '{first_name' + ':' + ' Jim}';
jsonReturn = jsonReturn + '{zip' + ':' + ' 12456}';
Therefore: email, user_type, first_name and zip are my four names and the values follow (e.g. jim.secondname@test.com is a value.
Does the above look like a correct JSON Clear Text String being created?
Thanks in advance.
ASKER
or is the following correct
{emailjim.secondname@test. com,user_t ype:Sales Rep,first_name: Jim,zip:12456}
{emailjim.secondname@test.
yes you can just build the string if thats your preference
> {emailjim.secondname@test. com,user_t ype:Sales Rep,first_name: Jim,zip:12456}
that last one is correct
> {emailjim.secondname@test.
that last one is correct
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
{email:jim.secondname@test
Thanks