How Do I Escape an Apostrophe in a REST API Query?
I am trying to write a REST API query that looks like this:
https://<server>:<port>/ccm/rpt/workitem?fields=workitem[projectArea/name="Nate's Sandbox Area"]/*
If the project area name does not have an apostrophe in it, this works fine. As soon as I put the apostrophe in there, I get zero results. The page doesn't display an error or complain about a badly formatted request, I just get a page with zero results.
How do I correctly escape an apostrophe in this scenario?
One answer
Well, as you don't mention what you have tried, I don't think encoding will help. You might try doubling the single quote:
[projectArea/name="Nate''s Sandbox Area"]
[projectArea/name="Nate''s Sandbox Area"]
Comments
Donald Nong
Sep 04 '14, 9:48 p.m.