I want to pass a quotation mark into JSON but the escape methods I'm using don't appear to be working. How do you pass a strong into JSON with a quotation mark?
[
{
"attributes": {
"OBJECTID": 307,
"Comments": "This is a test "with quotes""
}
}
]
I would try \" :
[
{
"attributes": {
"OBJECTID": 307,
"Comments": "This is a test \"with quotes\""
}
}
]
Didn't work. I'm using Integromat push this JSON. Integromat has dynamic data modules that are passed in...don't know if this is causing the issue.
Also, not every time the user will enter quotes in the text box.
If escaping isn't working, I would try raw string formatting or triple-quoted literals.
Already have Integromat set to RAW body type
For your example, I am talking about Python raw strings or triple-quotes:
>>> print(r'This is a test "with quotes"')
This is a test "with quotes"
>>> print('''This is a test "with quotes"''')
This is a test "with quotes"
>>>
I'm using JSON
Apologies, I thought this was posted in ArcGIS API for Python, not ArcGIS REST API
It might be worth reviewing 2.4.1 String and Bytes literals, 2. Lexical Analysis -- Python 3.6.
The text appearing in the "Value" window doesn't look like well formed JSON. It looks like it is a paste inside a previous paste. If you want "feature" inside the window, it should be in quotes as should "attributes" along with some commas in there. I would also suspect that the Name should be "features" not "updates". I must admit, however, that I am not very familiar with Integromat. To check your JSON, try jsonlint.