Select to view content in your preferred language

POST a json object to REST API

2499
0
08-01-2013 12:57 PM
GeorgeSimpson
Regular Contributor
Has anyone been able to successfully do this?  I have a c# object representing a Query that I want to submit to the REST API.  I have serialized the object into a string and posted the string but get errors.  The only solution I've found is to basically convert the string to a querystring and post that.

Basically, the object:

{f:"json", geometry:{xmin:0,ymin:0,xmax:100,ymax:100},geometryType:"esriGeometryEnvelope"}

has to be posted as:

f=json&geometry={xmin=0,ymin=0,xmax=100,ymax=100}&geometryType=esriGeometryEnvelope

instead of the actual JSON string.

Ideas?
0 Kudos
0 Replies