I am trying to query a FeatureLayer. I can connect to the GIS (using IWA), I validate the connection by checking the User, so I know the GIS object is valid.
Create a FeatureLayer object using a valid Url (the FeatureLayer object is created). But when I run query I get RuntimeError: Token Required (Error Code: 499). See full stack trace below. Pretty simple code
gis <SPAN class="operator token">=</SPAN> GIS<SPAN class="punctuation token">(</SPAN>portal<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">''</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">''</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="comment token"># IWA</SPAN>
<SPAN class="comment token"># get the webmap to use offline</SPAN>
offline_map_item <SPAN class="operator token">=</SPAN> gis<SPAN class="punctuation token">.</SPAN>content<SPAN class="punctuation token">.</SPAN>get<SPAN class="punctuation token">(</SPAN>webmap<SPAN class="punctuation token">)</SPAN>
offline_webmap <SPAN class="operator token">=</SPAN> WebMap<SPAN class="punctuation token">(</SPAN>offline_map_item<SPAN class="punctuation token">)</SPAN>
featureLayer <SPAN class="operator token">=</SPAN> FeatureLayer<SPAN class="punctuation token">(</SPAN>projects_url<SPAN class="punctuation token">,</SPAN> gis<SPAN class="punctuation token">)</SPAN>
features <SPAN class="operator token">=</SPAN> featureLayer<SPAN class="punctuation token">.</SPAN>query<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>
The issue is I see no way you would pass a token to this method. I passed the GIS object when initializing the FeatureLayer and the server is federated so I would think this passes the required tokens. Can some please help explain how I should be passing a token to this method from an IWA configured portal to a federated server in this call.
Thanks
-Joe
Stack trace:
RuntimeError Traceback <SPAN class="punctuation token">(</SPAN>most recent call last<SPAN class="punctuation token">)</SPAN>
C<SPAN class="punctuation token">:</SPAN>\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro<SPAN class="operator token">-</SPAN>py3\lib\site<SPAN class="operator token">-</SPAN>packages\arcgis\gis\__init__<SPAN class="punctuation token">.</SPAN>py <SPAN class="keyword token">in</SPAN> _hydrate<SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">7577</SPAN>
<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> <SPAN class="number token">7578</SPAN> self<SPAN class="punctuation token">.</SPAN>_refresh<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">7579</SPAN>
C<SPAN class="punctuation token">:</SPAN>\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro<SPAN class="operator token">-</SPAN>py3\lib\site<SPAN class="operator token">-</SPAN>packages\arcgis\gis\__init__<SPAN class="punctuation token">.</SPAN>py <SPAN class="keyword token">in</SPAN> _refresh<SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">7544</SPAN> <SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> <SPAN class="number token">7545</SPAN> dictdata <SPAN class="operator token">=</SPAN> self<SPAN class="punctuation token">.</SPAN>_con<SPAN class="punctuation token">.</SPAN>post<SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">.</SPAN>url<SPAN class="punctuation token">,</SPAN> params<SPAN class="punctuation token">,</SPAN> token<SPAN class="operator token">=</SPAN>self<SPAN class="punctuation token">.</SPAN>_lazy_token<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">7546</SPAN>
C<SPAN class="punctuation token">:</SPAN>\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro<SPAN class="operator token">-</SPAN>py3\lib\site<SPAN class="operator token">-</SPAN>packages\arcgis\_impl\connection<SPAN class="punctuation token">.</SPAN>py <SPAN class="keyword token">in</SPAN> post<SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">,</SPAN> path<SPAN class="punctuation token">,</SPAN> postdata<SPAN class="punctuation token">,</SPAN> files<SPAN class="punctuation token">,</SPAN> ssl<SPAN class="punctuation token">,</SPAN> compress<SPAN class="punctuation token">,</SPAN> is_retry<SPAN class="punctuation token">,</SPAN> use_ordered_dict<SPAN class="punctuation token">,</SPAN> add_token<SPAN class="punctuation token">,</SPAN> verify_cert<SPAN class="punctuation token">,</SPAN> token<SPAN class="punctuation token">,</SPAN> try_json<SPAN class="punctuation token">,</SPAN> out_folder<SPAN class="punctuation token">,</SPAN> file_name<SPAN class="punctuation token">,</SPAN> force_bytes<SPAN class="punctuation token">,</SPAN> add_headers<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">1155</SPAN>
<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> <SPAN class="number token">1156</SPAN> self<SPAN class="punctuation token">.</SPAN>_handle_json_error<SPAN class="punctuation token">(</SPAN>resp_json<SPAN class="punctuation token">[</SPAN><SPAN class="string token">'error'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> errorcode<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">1157</SPAN> <SPAN class="keyword token">return</SPAN> None
C<SPAN class="punctuation token">:</SPAN>\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro<SPAN class="operator token">-</SPAN>py3\lib\site<SPAN class="operator token">-</SPAN>packages\arcgis\_impl\connection<SPAN class="punctuation token">.</SPAN>py <SPAN class="keyword token">in</SPAN> _handle_json_error<SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">,</SPAN> error<SPAN class="punctuation token">,</SPAN> errorcode<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">1176</SPAN> errormessage <SPAN class="operator token">=</SPAN> errormessage <SPAN class="operator token">+</SPAN> <SPAN class="string token">"\n(Error Code: "</SPAN> <SPAN class="operator token">+</SPAN> str<SPAN class="punctuation token">(</SPAN>errorcode<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">+</SPAN><SPAN class="string token">")"</SPAN>
<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> <SPAN class="number token">1177</SPAN> <SPAN class="keyword token">raise</SPAN> RuntimeError<SPAN class="punctuation token">(</SPAN>errormessage<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">1178</SPAN>
RuntimeError<SPAN class="punctuation token">:</SPAN> Token Required
<SPAN class="punctuation token">(</SPAN>Error Code<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">499</SPAN><SPAN class="punctuation token">)</SPAN>
During handling of the above exception<SPAN class="punctuation token">,</SPAN> another exception occurred<SPAN class="punctuation token">:</SPAN>
RuntimeError Traceback <SPAN class="punctuation token">(</SPAN>most recent call last<SPAN class="punctuation token">)</SPAN>
C<SPAN class="punctuation token">:</SPAN>\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro<SPAN class="operator token">-</SPAN>py3\lib\site<SPAN class="operator token">-</SPAN>packages\arcgis\gis\__init__<SPAN class="punctuation token">.</SPAN>py <SPAN class="keyword token">in</SPAN> _hydrate<SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">7586</SPAN> self<SPAN class="punctuation token">.</SPAN>_lazy_token <SPAN class="operator token">=</SPAN> None
<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> <SPAN class="number token">7587</SPAN> self<SPAN class="punctuation token">.</SPAN>_refresh<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">7588</SPAN>
C<SPAN class="punctuation token">:</SPAN>\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro<SPAN class="operator token">-</SPAN>py3\lib\site<SPAN class="operator token">-</SPAN>packages\arcgis\gis\__init__<SPAN class="punctuation token">.</SPAN>py <SPAN class="keyword token">in</SPAN> _refresh<SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">7544</SPAN> <SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> <SPAN class="number token">7545</SPAN> dictdata <SPAN class="operator token">=</SPAN> self<SPAN class="punctuation token">.</SPAN>_con<SPAN class="punctuation token">.</SPAN>post<SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">.</SPAN>url<SPAN class="punctuation token">,</SPAN> params<SPAN class="punctuation token">,</SPAN> token<SPAN class="operator token">=</SPAN>self<SPAN class="punctuation token">.</SPAN>_lazy_token<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">7546</SPAN>
C<SPAN class="punctuation token">:</SPAN>\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro<SPAN class="operator token">-</SPAN>py3\lib\site<SPAN class="operator token">-</SPAN>packages\arcgis\_impl\connection<SPAN class="punctuation token">.</SPAN>py <SPAN class="keyword token">in</SPAN> post<SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">,</SPAN> path<SPAN class="punctuation token">,</SPAN> postdata<SPAN class="punctuation token">,</SPAN> files<SPAN class="punctuation token">,</SPAN> ssl<SPAN class="punctuation token">,</SPAN> compress<SPAN class="punctuation token">,</SPAN> is_retry<SPAN class="punctuation token">,</SPAN> use_ordered_dict<SPAN class="punctuation token">,</SPAN> add_token<SPAN class="punctuation token">,</SPAN> verify_cert<SPAN class="punctuation token">,</SPAN> token<SPAN class="punctuation token">,</SPAN> try_json<SPAN class="punctuation token">,</SPAN> out_folder<SPAN class="punctuation token">,</SPAN> file_name<SPAN class="punctuation token">,</SPAN> force_bytes<SPAN class="punctuation token">,</SPAN> add_headers<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">1155</SPAN>
<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> <SPAN class="number token">1156</SPAN> self<SPAN class="punctuation token">.</SPAN>_handle_json_error<SPAN class="punctuation token">(</SPAN>resp_json<SPAN class="punctuation token">[</SPAN><SPAN class="string token">'error'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> errorcode<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">1157</SPAN> <SPAN class="keyword token">return</SPAN> None
C<SPAN class="punctuation token">:</SPAN>\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro<SPAN class="operator token">-</SPAN>py3\lib\site<SPAN class="operator token">-</SPAN>packages\arcgis\_impl\connection<SPAN class="punctuation token">.</SPAN>py <SPAN class="keyword token">in</SPAN> _handle_json_error<SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">,</SPAN> error<SPAN class="punctuation token">,</SPAN> errorcode<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">1176</SPAN> errormessage <SPAN class="operator token">=</SPAN> errormessage <SPAN class="operator token">+</SPAN> <SPAN class="string token">"\n(Error Code: "</SPAN> <SPAN class="operator token">+</SPAN> str<SPAN class="punctuation token">(</SPAN>errorcode<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">+</SPAN><SPAN class="string token">")"</SPAN>
<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> <SPAN class="number token">1177</SPAN> <SPAN class="keyword token">raise</SPAN> RuntimeError<SPAN class="punctuation token">(</SPAN>errormessage<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">1178</SPAN>
RuntimeError<SPAN class="punctuation token">:</SPAN> Token Required
<SPAN class="punctuation token">(</SPAN>Error Code<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">499</SPAN><SPAN class="punctuation token">)</SPAN>
During handling of the above exception<SPAN class="punctuation token">,</SPAN> another exception occurred<SPAN class="punctuation token">:</SPAN>
RuntimeError Traceback <SPAN class="punctuation token">(</SPAN>most recent call last<SPAN class="punctuation token">)</SPAN>
<SPAN class="operator token"><</SPAN>ipython<SPAN class="operator token">-</SPAN>input<SPAN class="number token">-12</SPAN><SPAN class="operator token">-</SPAN><SPAN class="number token">554803401d1a</SPAN><SPAN class="operator token">></SPAN> <SPAN class="keyword token">in</SPAN> <SPAN class="operator token"><</SPAN>module<SPAN class="operator token">></SPAN>
<SPAN class="number token">2</SPAN>
<SPAN class="number token">3</SPAN> featureLayer <SPAN class="operator token">=</SPAN> FeatureLayer<SPAN class="punctuation token">(</SPAN>projects_url<SPAN class="punctuation token">,</SPAN> gis<SPAN class="punctuation token">)</SPAN>
<SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> <SPAN class="number token">4</SPAN> features <SPAN class="operator token">=</SPAN> featureLayer<SPAN class="punctuation token">.</SPAN>query<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
C<SPAN class="punctuation token">:</SPAN>\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro<SPAN class="operator token">-</SPAN>py3\lib\site<SPAN class="operator token">-</SPAN>packages\arcgis\features\layer<SPAN class="punctuation token">.</SPAN>py <SPAN class="keyword token">in</SPAN> query<SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">,</SPAN> where<SPAN class="punctuation token">,</SPAN> out_fields<SPAN class="punctuation token">,</SPAN> time_filter<SPAN class="punctuation token">,</SPAN> geometry_filter<SPAN class="punctuation token">,</SPAN> return_geometry<SPAN class="punctuation token">,</SPAN> return_count_only<SPAN class="punctuation token">,</SPAN> return_ids_only<SPAN class="punctuation token">,</SPAN> return_distinct_values<SPAN class="punctuation token">,</SPAN> return_extent_only<SPAN class="punctuation token">,</SPAN> group_by_fields_for_statistics<SPAN class="punctuation token">,</SPAN> statistic_filter<SPAN class="punctuation token">,</SPAN> result_offset<SPAN class="punctuation token">,</SPAN> result_record_count<SPAN class="punctuation token">,</SPAN> object_ids<SPAN class="punctuation token">,</SPAN> distance<SPAN class="punctuation token">,</SPAN> units<SPAN class="punctuation token">,</SPAN> max_allowable_offset<SPAN class="punctuation token">,</SPAN> out_sr<SPAN class="punctuation token">,</SPAN> geometry_precision<SPAN class="punctuation token">,</SPAN> gdb_version<SPAN class="punctuation token">,</SPAN> order_by_fields<SPAN class="punctuation token">,</SPAN> out_statistics<SPAN class="punctuation token">,</SPAN> return_z<SPAN class="punctuation token">,</SPAN> return_m<SPAN class="punctuation token">,</SPAN> multipatch_option<SPAN class="punctuation token">,</SPAN> quantization_parameters<SPAN class="punctuation token">,</SPAN> return_centroid<SPAN class="punctuation token">,</SPAN> return_all_records<SPAN class="punctuation token">,</SPAN> result_type<SPAN class="punctuation token">,</SPAN> historic_moment<SPAN class="punctuation token">,</SPAN> sql_format<SPAN class="punctuation token">,</SPAN> return_true_curves<SPAN class="punctuation token">,</SPAN> return_exceeded_limit_features<SPAN class="punctuation token">,</SPAN> <SPAN class="operator token">**</SPAN>kwargs<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">567</SPAN>
<SPAN class="number token">568</SPAN> params<SPAN class="punctuation token">[</SPAN><SPAN class="string token">'returnCountOnly'</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> <SPAN class="token boolean">True</SPAN>
<SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> <SPAN class="number token">569</SPAN> record_count <SPAN class="operator token">=</SPAN> self<SPAN class="punctuation token">.</SPAN>_query<SPAN class="punctuation token">(</SPAN>url<SPAN class="punctuation token">,</SPAN> params<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">570</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="string token">'maxRecordCount'</SPAN> <SPAN class="keyword token">in</SPAN> self<SPAN class="punctuation token">.</SPAN>properties<SPAN class="punctuation token">:</SPAN>
<SPAN class="number token">571</SPAN> max_records <SPAN class="operator token">=</SPAN> self<SPAN class="punctuation token">.</SPAN>properties<SPAN class="punctuation token">[</SPAN><SPAN class="string token">'maxRecordCount'</SPAN><SPAN class="punctuation token">]</SPAN>
C<SPAN class="punctuation token">:</SPAN>\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro<SPAN class="operator token">-</SPAN>py3\lib\site<SPAN class="operator token">-</SPAN>packages\arcgis\features\layer<SPAN class="punctuation token">.</SPAN>py <SPAN class="keyword token">in</SPAN> _query<SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">,</SPAN> url<SPAN class="punctuation token">,</SPAN> params<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">1194</SPAN> <SPAN class="string token">""" returns results of query """</SPAN>
<SPAN class="number token">1195</SPAN> result <SPAN class="operator token">=</SPAN> self<SPAN class="punctuation token">.</SPAN>_con<SPAN class="punctuation token">.</SPAN>post<SPAN class="punctuation token">(</SPAN>path<SPAN class="operator token">=</SPAN>url<SPAN class="punctuation token">,</SPAN>
<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> <SPAN class="number token">1196</SPAN> postdata<SPAN class="operator token">=</SPAN>params<SPAN class="punctuation token">,</SPAN> token<SPAN class="operator token">=</SPAN>self<SPAN class="punctuation token">.</SPAN>_token<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">1197</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="string token">'error'</SPAN> <SPAN class="keyword token">in</SPAN> result<SPAN class="punctuation token">:</SPAN>
<SPAN class="number token">1198</SPAN> <SPAN class="keyword token">raise</SPAN> ValueError<SPAN class="punctuation token">(</SPAN>result<SPAN class="punctuation token">)</SPAN>
C<SPAN class="punctuation token">:</SPAN>\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro<SPAN class="operator token">-</SPAN>py3\lib\site<SPAN class="operator token">-</SPAN>packages\arcgis\gis\__init__<SPAN class="punctuation token">.</SPAN>py <SPAN class="keyword token">in</SPAN> _token<SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">7606</SPAN> <SPAN class="keyword token">return</SPAN> self<SPAN class="punctuation token">.</SPAN>_lazy_token
<SPAN class="number token">7607</SPAN> <SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> <SPAN class="number token">7608</SPAN> self<SPAN class="punctuation token">.</SPAN>_hydrate<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">7609</SPAN> <SPAN class="keyword token">return</SPAN> self<SPAN class="punctuation token">.</SPAN>_lazy_token
<SPAN class="number token">7610</SPAN>
C<SPAN class="punctuation token">:</SPAN>\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro<SPAN class="operator token">-</SPAN>py3\lib\site<SPAN class="operator token">-</SPAN>packages\arcgis\gis\__init__<SPAN class="punctuation token">.</SPAN>py <SPAN class="keyword token">in</SPAN> _hydrate<SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">7594</SPAN> <SPAN class="comment token"># try token in the provided gis</SPAN>
<SPAN class="number token">7595</SPAN> self<SPAN class="punctuation token">.</SPAN>_lazy_token <SPAN class="operator token">=</SPAN> self<SPAN class="punctuation token">.</SPAN>_con<SPAN class="punctuation token">.</SPAN>token
<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> <SPAN class="number token">7596</SPAN> self<SPAN class="punctuation token">.</SPAN>_refresh<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">7597</SPAN>
<SPAN class="number token">7598</SPAN> <SPAN class="keyword token">if</SPAN> err <SPAN class="keyword token">is</SPAN> <SPAN class="operator token">not</SPAN> None<SPAN class="punctuation token">:</SPAN>
C<SPAN class="punctuation token">:</SPAN>\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro<SPAN class="operator token">-</SPAN>py3\lib\site<SPAN class="operator token">-</SPAN>packages\arcgis\gis\__init__<SPAN class="punctuation token">.</SPAN>py <SPAN class="keyword token">in</SPAN> _refresh<SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">7543</SPAN> dictdata <SPAN class="operator token">=</SPAN> self<SPAN class="punctuation token">.</SPAN>_con<SPAN class="punctuation token">.</SPAN>get<SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">.</SPAN>url<SPAN class="punctuation token">,</SPAN> params<SPAN class="punctuation token">,</SPAN> token<SPAN class="operator token">=</SPAN>self<SPAN class="punctuation token">.</SPAN>_lazy_token<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">7544</SPAN> <SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> <SPAN class="number token">7545</SPAN> dictdata <SPAN class="operator token">=</SPAN> self<SPAN class="punctuation token">.</SPAN>_con<SPAN class="punctuation token">.</SPAN>post<SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">.</SPAN>url<SPAN class="punctuation token">,</SPAN> params<SPAN class="punctuation token">,</SPAN> token<SPAN class="operator token">=</SPAN>self<SPAN class="punctuation token">.</SPAN>_lazy_token<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">7546</SPAN>
<SPAN class="number token">7547</SPAN> self<SPAN class="punctuation token">.</SPAN>_lazy_properties <SPAN class="operator token">=</SPAN> PropertyMap<SPAN class="punctuation token">(</SPAN>dictdata<SPAN class="punctuation token">)</SPAN>
C<SPAN class="punctuation token">:</SPAN>\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro<SPAN class="operator token">-</SPAN>py3\lib\site<SPAN class="operator token">-</SPAN>packages\arcgis\_impl\connection<SPAN class="punctuation token">.</SPAN>py <SPAN class="keyword token">in</SPAN> post<SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">,</SPAN> path<SPAN class="punctuation token">,</SPAN> postdata<SPAN class="punctuation token">,</SPAN> files<SPAN class="punctuation token">,</SPAN> ssl<SPAN class="punctuation token">,</SPAN> compress<SPAN class="punctuation token">,</SPAN> is_retry<SPAN class="punctuation token">,</SPAN> use_ordered_dict<SPAN class="punctuation token">,</SPAN> add_token<SPAN class="punctuation token">,</SPAN> verify_cert<SPAN class="punctuation token">,</SPAN> token<SPAN class="punctuation token">,</SPAN> try_json<SPAN class="punctuation token">,</SPAN> out_folder<SPAN class="punctuation token">,</SPAN> file_name<SPAN class="punctuation token">,</SPAN> force_bytes<SPAN class="punctuation token">,</SPAN> add_headers<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">1154</SPAN> verify_cert<SPAN class="operator token">=</SPAN>verify_cert<SPAN class="punctuation token">,</SPAN> is_retry<SPAN class="operator token">=</SPAN><SPAN class="token boolean">True</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">1155</SPAN>
<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> <SPAN class="number token">1156</SPAN> self<SPAN class="punctuation token">.</SPAN>_handle_json_error<SPAN class="punctuation token">(</SPAN>resp_json<SPAN class="punctuation token">[</SPAN><SPAN class="string token">'error'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> errorcode<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">1157</SPAN> <SPAN class="keyword token">return</SPAN> None
<SPAN class="number token">1158</SPAN>
C<SPAN class="punctuation token">:</SPAN>\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro<SPAN class="operator token">-</SPAN>py3\lib\site<SPAN class="operator token">-</SPAN>packages\arcgis\_impl\connection<SPAN class="punctuation token">.</SPAN>py <SPAN class="keyword token">in</SPAN> _handle_json_error<SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">,</SPAN> error<SPAN class="punctuation token">,</SPAN> errorcode<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">1175</SPAN>
<SPAN class="number token">1176</SPAN> errormessage <SPAN class="operator token">=</SPAN> errormessage <SPAN class="operator token">+</SPAN> <SPAN class="string token">"\n(Error Code: "</SPAN> <SPAN class="operator token">+</SPAN> str<SPAN class="punctuation token">(</SPAN>errorcode<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">+</SPAN><SPAN class="string token">")"</SPAN>
<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> <SPAN class="number token">1177</SPAN> <SPAN class="keyword token">raise</SPAN> RuntimeError<SPAN class="punctuation token">(</SPAN>errormessage<SPAN class="punctuation token">)</SPAN>
<SPAN class="number token">1178</SPAN>
<SPAN class="number token">1179</SPAN> <SPAN class="keyword token">class</SPAN> <SPAN class="token class-name">_StrictURLopener</SPAN><SPAN class="punctuation token">(</SPAN>request<SPAN class="punctuation token">.</SPAN>FancyURLopener<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
RuntimeError<SPAN class="punctuation token">:</SPAN> Token Required
<SPAN class="punctuation token">(</SPAN>Error Code<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">499</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></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>