<?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 applyEdits Failing – HTML Response Instead of JSON (ArcGIS Server 10.4, ArcGIS JS API 4.x) in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/applyedits-failing-html-response-instead-of-json/m-p/1615880#M7522</link>
    <description>&lt;P class=""&gt;Hello,&lt;/P&gt;&lt;P class=""&gt;I’m encountering an issue with the applyEdits operation on a Feature Service in ArcGIS Server 10.4, accessed via the ArcGIS API for JavaScript 4.x.&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;When making an applyEdits request to the Feature Service, instead of receiving the expected JSON response, I get an &lt;STRONG&gt;HTML page&lt;/STRONG&gt; with an error embedded in it. This causes the JavaScript API to throw a parsing error.&lt;/P&gt;&lt;P class=""&gt;URL: FeatureServer/0/applyEdits&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const response = await this.featureLayer.queryFeatures(query);
for (const item of response.features) {
const geometry = new Point(item.geometry);
    const graphic = new Graphic({
    geometry,
    attributes: attr
     });
features.push(graphic);
}
this.featureLayer.applyEdits(edits, options).then(function(results) {
  }).catch(function(error) {
   console.error("Error applying edits:", error);
});

const edits = {
    addFeatures:null,
    deleteFeatures: null,
    updateFeatures: features
};
                
const options = {
    globalIdUsed: false,
    rollbackOnFailureEnabled: false
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Important note:&lt;/STRONG&gt;&lt;/P&gt;&lt;P class=""&gt;This call is not made manually — it's triggered by the API's&amp;nbsp; applyedits function.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;The Feature Service is accessed via a proxy, which works fine for other requests (e.g., query)&lt;/P&gt;&lt;P class=""&gt;The same service and code work perfectly with ArcGIS JavaScript API 3.x, including applyedits.&lt;/P&gt;</description>
    <pubDate>Mon, 19 May 2025 08:14:35 GMT</pubDate>
    <dc:creator>alabanu</dc:creator>
    <dc:date>2025-05-19T08:14:35Z</dc:date>
    <item>
      <title>applyEdits Failing – HTML Response Instead of JSON (ArcGIS Server 10.4, ArcGIS JS API 4.x)</title>
      <link>https://community.esri.com/t5/developers-questions/applyedits-failing-html-response-instead-of-json/m-p/1615880#M7522</link>
      <description>&lt;P class=""&gt;Hello,&lt;/P&gt;&lt;P class=""&gt;I’m encountering an issue with the applyEdits operation on a Feature Service in ArcGIS Server 10.4, accessed via the ArcGIS API for JavaScript 4.x.&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;When making an applyEdits request to the Feature Service, instead of receiving the expected JSON response, I get an &lt;STRONG&gt;HTML page&lt;/STRONG&gt; with an error embedded in it. This causes the JavaScript API to throw a parsing error.&lt;/P&gt;&lt;P class=""&gt;URL: FeatureServer/0/applyEdits&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const response = await this.featureLayer.queryFeatures(query);
for (const item of response.features) {
const geometry = new Point(item.geometry);
    const graphic = new Graphic({
    geometry,
    attributes: attr
     });
features.push(graphic);
}
this.featureLayer.applyEdits(edits, options).then(function(results) {
  }).catch(function(error) {
   console.error("Error applying edits:", error);
});

const edits = {
    addFeatures:null,
    deleteFeatures: null,
    updateFeatures: features
};
                
const options = {
    globalIdUsed: false,
    rollbackOnFailureEnabled: false
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Important note:&lt;/STRONG&gt;&lt;/P&gt;&lt;P class=""&gt;This call is not made manually — it's triggered by the API's&amp;nbsp; applyedits function.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;The Feature Service is accessed via a proxy, which works fine for other requests (e.g., query)&lt;/P&gt;&lt;P class=""&gt;The same service and code work perfectly with ArcGIS JavaScript API 3.x, including applyedits.&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2025 08:14:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/applyedits-failing-html-response-instead-of-json/m-p/1615880#M7522</guid>
      <dc:creator>alabanu</dc:creator>
      <dc:date>2025-05-19T08:14:35Z</dc:date>
    </item>
  </channel>
</rss>

