Invalid html content in json request body

3780
4
10-29-2015 07:33 AM
Highlighted
New Contributor II

Hi all,

I have a peculiar problem with posting data via the /applyEdits rest endpoint to a service in ArcGIS Online.

The feature contains a string attribute "LOG_OPM" which contains the following text:

"kast 1 richting 2 3 A Groen <dub ov> vervangen nacht"

(double quotes added for clarity)

When posting this as an update through the applyEdits endpoint, the following error is returned:

Field LOG_OPM has invalid html content

Obviously this is not meant to be HTML but the parser thinks it is.

Escaping the < and > like this:

"kast 1 richting 2 3 A Groen \u003cdub ov\u003e vervangen nacht"

results in the same error.

How should I escape or encode this string so that the parser stores it properly without thinking it's invalid HTML?

This is part of a C# application, I should add.

Thanks in advance,

Eva

Reply
0 Kudos
4 Replies
Highlighted
Occasional Contributor II

Geospatial World: ArcGIS Collector: Update Error Code 1006 This helped me last time!

Go to your ArcGIS Server Admin page, select the Feature Service that is causing the problem and Edit the Feature Service.  Select the Capabilities item and select Feature Class within the Capabilities tab.  Near the bottom you will see a button labelled Advanced Options

Click the Advanced Options button and you will be presented with the following dialog.

Uncheck the Filter web content toggle and restart the service and the error should be gone.

Highlighted
New Contributor II

Yes, that did the trick. Thanks!

Reply
0 Kudos
Highlighted
Occasional Contributor II

Glad It worked!

Cheers,

Pramod

Reply
0 Kudos
Highlighted
New Contributor III

I know this is an old thread but this is an issue with ArcGIS Server 10.6.1, the recommended solution solved our issue of "Invalid untrusted Html content detected in field".  Once web filter web content was disabled and service was restarted user was able to sync in Collector.