Invalid html content in json request body

6368
6
10-29-2015 07:33 AM
EvaDienske
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

0 Kudos
6 Replies
PramodHarithsa1
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.

EvaDienske
New Contributor II

Yes, that did the trick. Thanks!

0 Kudos
PramodHarithsa1
Occasional Contributor II

Glad It worked!

Cheers,

Pramod

0 Kudos
JerrySimmons_GISP
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.

Brian_Laws
Occasional Contributor

Had this issue come up with submitting data in Field Maps and this solution worked for me.  Thanks!!

0 Kudos
AaronVaughn1
New Contributor II

Updating this thread as I am working on 10.9.1. When I go to capabilities and look at the feature access this filter web content is not to be seen, no radio button, checklist whatever. Then, fooling around, I unchecked feature service, then checked it again and more options came up, including the 'Advanced Options'. And therein was that silly hidden check box where I could uncheck filtering. This is so one layer, and one column's notes field, didn't have the json parser flagging the field worker's clever arrow emoji ----> as 'untrusted' html (I spend way too much time on troubleshooting this). Here's the snip:

AaronVaughn1_0-1665079068451.pngAaronVaughn1_1-1665079178817.png

 

0 Kudos