Using v4.9 of JS API, trying to upload a KML or KMZ to a geoprocessing service that has uploads enabled.
Struggling on how to format my esriRequest:
Here is what I have:
<SPAN class="token function">esriRequest</SPAN><SPAN class="punctuation token">(</SPAN>
<SPAN class="string token">"https://mygisserver/arcgis/rest/services/Geoprocessing/UploadKML/GPServer/uploads/upload"</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">{</SPAN>
body<SPAN class="punctuation token">:</SPAN> document<SPAN class="punctuation token">.</SPAN><SPAN class="token function">getElementById</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"uploadForm"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN>
method<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'post'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="comment token">//useProxy:true,</SPAN>
responseType<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'json'</SPAN><SPAN class="punctuation token">,</SPAN>
query<SPAN class="punctuation token">:</SPAN><SPAN class="punctuation token">{</SPAN><SPAN class="string token">'f'</SPAN><SPAN class="punctuation token">:</SPAN><SPAN class="string token">'json'</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="comment token">//headers: {'Content-Type': 'multipart/form-data'},</SPAN>
headers<SPAN class="punctuation token">:</SPAN><SPAN class="punctuation token">{</SPAN><SPAN class="string token">'Content-Type'</SPAN><SPAN class="punctuation token">:</SPAN><SPAN class="string token">'application/x-www-form-urlencoded'</SPAN><SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN> I've tried a lot of different combinations of headers, my proxy is working, but I keep getting errors like
PROXY OFF
Unexpected token < in JSON at position x (where x is a number) with no headers
Error parsing multi-part request with multipart/form-data headers
Error performing upload operation with application/x-www-form-urlencoded headers
PROXY ON
Unable to load https://gisdev.eon.faa.gov/proxy/pr… an error in handleAs: transformation of response with any headers.
Any ideas here?