<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to escape strings in feature update requests? in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/how-to-escape-strings-in-feature-update-requests/m-p/580060#M2782</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: rlwatson&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/system.uri.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.uri.aspx&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Mar 2011 20:55:05 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2011-03-15T20:55:05Z</dc:date>
    <item>
      <title>How to escape strings in feature update requests?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/how-to-escape-strings-in-feature-update-requests/m-p/580059#M2781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: aaverett&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been struggling with this for a couple of weeks now, and I can't figure it out.&amp;nbsp; It doesn't appear to be documented anywhere in the docs that come with ArcGIS Server, and Google turns up nothing useful at all.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need a reference or some description of what the proper way to escape special characters in requests to the REST API is.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For instance, here is a request, sent to the following address:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://hostname/ArcGIS/rest/services/servicename/FeatureServer/0/updateFeatures" rel="nofollow noopener noreferrer" target="_blank"&gt;http://hostname/ArcGIS/rest/services/servicename/FeatureServer/0/updateFeatures&lt;/A&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
f=json&amp;amp;features=[{
 "geometry" : null,
 "attributes" : 
 {
&amp;nbsp; "OBJECTID" : 1366095,
&amp;nbsp; "api_number" : "420413176600",
&amp;nbsp; "alt_well_ident" : "M082078",
&amp;nbsp; "_operator" : 115974,
&amp;nbsp; "reservoir" : 51334,
&amp;nbsp; "ground_elevation" : null,
&amp;nbsp; "kb_elevation" : null,
&amp;nbsp; "total_depth" : null,
&amp;nbsp; "location" : "474.6'FNW UNIT &amp;amp; 1460.63'FSW UNIT ELI SEALE 028 SUR SEALE 028 SUR",
&amp;nbsp; "comment" : null,
&amp;nbsp; "SHAPE" : null,
&amp;nbsp; "drill_date" : null,
&amp;nbsp; "lease_name" : "CONNER ODOM UNIT #1",
&amp;nbsp; "well_number" : null,
&amp;nbsp; "approx" : false,
&amp;nbsp; "state_fips" : 48,
&amp;nbsp; "county_fips" : 41,
&amp;nbsp; "_abstract" : null,
&amp;nbsp; "district" : null,
&amp;nbsp; "section" : null,
&amp;nbsp; "block" : null,
&amp;nbsp; "survey" : null
 }
}]
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That request returns a 400 error message that talks about "invalid graphic features."&amp;nbsp; Some trial and error revealed that it works if I remove the ampersand character in the "location" attribute.&amp;nbsp; I found that it also works if I replace the ampersand with a hexadecimal escape - "%26" in this case.&amp;nbsp; Doing the same thing also works for string values containing a modulus character.&amp;nbsp; It doesn't work with just the literal modulus, but replacing it with "%25" allows the request to succeed, and returns a valid result.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem I have with this is that the escaped characters are not un-escaped on the server side, so I still have the "%26" when I call the record up again.&amp;nbsp; Un-escaping them on the client side is technically possible, but not ideal, because there are other clients for this dataset that would have to be modified as well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone point me toward a reference that explains how these characters are supposed to be handled?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:56:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/how-to-escape-strings-in-feature-update-requests/m-p/580059#M2781</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T00:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to escape strings in feature update requests?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/how-to-escape-strings-in-feature-update-requests/m-p/580060#M2782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: rlwatson&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/system.uri.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.uri.aspx&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2011 20:55:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/how-to-escape-strings-in-feature-update-requests/m-p/580060#M2782</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-03-15T20:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to escape strings in feature update requests?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/how-to-escape-strings-in-feature-update-requests/m-p/1015713#M3677</link>
      <description>&lt;P&gt;I have the same problem and I don't understand how the suggested solution relates to the question...&lt;/P&gt;&lt;P&gt;Edit: never mind - URL encoding (%26) works for me.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 07:19:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/how-to-escape-strings-in-feature-update-requests/m-p/1015713#M3677</guid>
      <dc:creator>JasonWood</dc:creator>
      <dc:date>2021-01-12T07:19:17Z</dc:date>
    </item>
  </channel>
</rss>

