Last post Sep 10, 2020 12:45 PM by mgebhard
Member
126 Points
801 Posts
Sep 10, 2020 12:21 PM|micnie2020|LINK
Hi All,
I have Json data that want to pass to API. However the " in the description caused failure. How to use regex to handle single quote & etc special character?
Example Json File:
[ { "ID": 0, "Date": "2020-09-10T09:43:22.843Z", "Requestor": "xxx", "Description": "Windows 6.1" Iphone XR, +1-Carbon' for site...", "Qty": "xx", "Currency": "xx", "Price": 0, "Supplier": "xx", "UniqueId": "ddd" } ]
Please advise.
Thanks
Regards,
Micheale
All-Star
53661 Points
24019 Posts
Sep 10, 2020 12:45 PM|mgebhard|LINK
Typically, the quote is escaped or encoded.
[ { "ID": 0, "Date": "2020-09-10T09:43:22.843Z", "Requestor": "xxx", "Description": "Windows 6.1\" Iphone XR, +1-Carbon' for site...", "Qty": "xx", "Currency": "xx", "Price": 0, "Supplier": "xx", "UniqueId": "ddd" } ]
Member
126 Points
801 Posts
How to pass Json data with special character to API
Sep 10, 2020 12:21 PM|micnie2020|LINK
Hi All,
I have Json data that want to pass to API. However the " in the description caused failure. How to use regex to handle single quote & etc special character?
Example Json File:
[
{
"ID": 0,
"Date": "2020-09-10T09:43:22.843Z",
"Requestor": "xxx",
"Description": "Windows 6.1" Iphone XR, +1-Carbon' for site...",
"Qty": "xx",
"Currency": "xx",
"Price": 0,
"Supplier": "xx",
"UniqueId": "ddd"
}
]
Please advise.
Thanks
Regards,
Micheale
All-Star
53661 Points
24019 Posts
Re: How to pass Json data with special character to API
Sep 10, 2020 12:45 PM|mgebhard|LINK
Typically, the quote is escaped or encoded.
[ { "ID": 0, "Date": "2020-09-10T09:43:22.843Z", "Requestor": "xxx", "Description": "Windows 6.1\" Iphone XR, +1-Carbon' for site...", "Qty": "xx", "Currency": "xx", "Price": 0, "Supplier": "xx", "UniqueId": "ddd" } ]