My string for my AJAX GET request looks like the following:
return domain + '?x=' + JSON.stringify(x)
Do need to use encodeUriComponent
to make the URI valid? For example:
return domain + '?x=' + encodeURIComponent(JSON.stringify(x))
My string for my AJAX GET request looks like the following:
return domain + '?x=' + JSON.stringify(x)
Do need to use encodeUriComponent
to make the URI valid? For example:
return domain + '?x=' + encodeURIComponent(JSON.stringify(x))
JSON.stringify
doesn't escape characters, it just returns you string representation and as you are using it in url you need to escape it using encodeURIComponent
Yes. The JSON is expressed as a text and you are adding it as a component of a URI, so you should.
This is what I understand from reading some posts and answers (please feel free to correct me)
JSON - JavaScript Object Notation
Regardless to JSON:
I used these answers for my summary:
can use rc4 encode(or base64 if content not too length) in url then decode in process file