object ob = new{ data = "hello"};
string json = Global.ZennoLab.Json.JsonConvert.SerializeObject(ob);
project.SendInfoToLog(json);
json = Global.ZennoLab.Json.JsonConvert.SerializeObject(json);
project.SendInfoToLog(json);
I don't quite understand your methodtry escaping by:
@"Your JSON data string"
I need to send content via REST API WordPressYou write what you want.
What is the input data?
What data do you want to get out?
This fonction will escape all illegal json characteres ? Can I put several input variable ?Посмотреть вложение 93429C#:object ob = new{ data = "hello"}; string json = Global.ZennoLab.Json.JsonConvert.SerializeObject(ob); project.SendInfoToLog(json); json = Global.ZennoLab.Json.JsonConvert.SerializeObject(json); project.SendInfoToLog(json);
I need to send content via REST API WordPress
I need to escape all json illegal characteres : https://www.tutorialspoint.com/json_simple/json_simple_escape_characters.htm
string line = "Text with special character /\"\'\b\f\t\r\n.";
line = Regex.Escape(line);
return line;
In my answer, an example of how you can generate JSON, where you can substitute data from your variables. And then C# will take care of generating a valid JSON text.This fonction will escape all illegal json characteres ? Can I put several input variable ?
This is not the first time you have helped me. Thanks for your help
string line = project.Variables["variable1"].Value;
line = Regex.Escape(line);
return line;
string line = project.Variables["variable2"].Value;
line = Regex.Escape(line);
return line;
Thanks for your help, what is the syntax if I want to escape several variables without merging them
I'm pretty sure it's not that:
C#:string line = project.Variables["variable1"].Value; line = Regex.Escape(line); return line; string line = project.Variables["variable2"].Value; line = Regex.Escape(line); return line;
project.Variables["variable1"].Value = Regex.Escape(project.Variables["variable1"].Value);
project.Variables["variable2"].Value = Regex.Escape(project.Variables["variable2"].Value);
Can you send me the complete syntax please.project.Variables["variable1"].Value = Regex.Escape(project.Variables["variable1"].Value); project.Variables["variable2"].Value = Regex.Escape(project.Variables["variable2"].Value);
Can you send me the complete syntax please.C#:
project.Variables["variable1"].Value = Regex.Escape(project.Variables["variable1"].Value);
project.Variables["variable2"].Value = Regex.Escape(project.Variables["variable2"].Value);