# ArcGisRestLayer Error 400 Bad Request

**URL:** <https://community.thinkgeo.com/t/arcgisrestlayer-error-400-bad-request/9353>\
**Category:** WinForms\
**Created:** [November 29, 2018, 1:21pm UTC](https://community.thinkgeo.com/t/arcgisrestlayer-error-400-bad-request/9353 "2018-11-29T13:21:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_cowell](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/838e76/32.png) [@Sam\_cowell](https://community.thinkgeo.com/u/Sam_cowell)\
**Post date:** [November 29, 2018, 1:21pm UTC](https://community.thinkgeo.com/t/arcgisrestlayer-error-400-bad-request/9353/1 "2018-11-29T13:21:08Z")

</div>

Hello,

I’m having trouble getting a good response using the ArcGisServerRestLayer for the Natural England data sets which are presented by ArcGIS as Feature Services - are these supported?

```
arcGISServerRestLayer arcGisLayer = new ArcGISServerRestLayer();
arcGisLayer.ServerUri = new Uri("https://services.arcgis.com/JJzESW51TqeY9uat/ArcGIS/rest/services/DalbyFields/FeatureServer/query"); 

arcGisLayer.ImageFormat = ArcGISServerRestLayerImageFormat.Png;
arcGisLayer.Parameters.Add("layerDefs", @"[{'layerId' : 0}]");
arcGisLayer.Parameters.Add("returngeometry ", "true");

LayerOverlay layerOverlay = new LayerOverlay();
            layerOverlay.Layers.Add("ArcGISServerRestLayer", arcGisLayer);
            winformsMap1.Overlays.Add(layerOverlay);

```

The string built is:  
[https://services.arcgis.com/JJzESW51TqeY9uat/ArcGIS/rest/services/DalbyFields/FeatureServer/query?LAYERDEFS=%5B%7B%27layerId%27+%3A+0%7D%5D&RETURNGEOMETRY =true&BBOX=-142.735601382775%2C22.4045955348518%2C-55.2643986172248%2C67.5954044651482&SIZE=1653%2C854&format=Png&F=image](https://services.arcgis.com/JJzESW51TqeY9uat/ArcGIS/rest/services/DalbyFields/FeatureServer/query?LAYERDEFS=%5B%7B%27layerId%27+%3A+0%7D%5D&RETURNGEOMETRY%20=true&BBOX=-142.735601382775%2C22.4045955348518%2C-55.2643986172248%2C67.5954044651482&SIZE=1653%2C854&format=Png&F=image)

The request is fine(manually) if the F=Image is removed so I’m assuming my approach to this is wrong.

I have the current extent set.

Thanks,  
Sam

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [November 30, 2018, 6:14am UTC](https://community.thinkgeo.com/t/arcgisrestlayer-error-400-bad-request/9353/2 "2018-11-30T06:14:57Z")

</div>

Hi Sam,

Please refer this post: [ArcGISRestLayer URI Returning 404 Error](https://community.thinkgeo.com/t/arcgisrestlayer-uri-returning-404-error/8464)

It looks the server you chosen is not an image service, it only support 4 types operation:

[https://services.arcgis.com/JJzESW51TqeY9uat/ArcGIS/rest/services/DalbyFields/FeatureServer/0](https://services.arcgis.com/JJzESW51TqeY9uat/ArcGIS/rest/services/DalbyFields/FeatureServer/0)  
Supported Operations: Query, Query Top Features, Generate Renderer, Validate SQL

And the valid service for example: [http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI\_StateCityHighway\_USA/MapServer](http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer)  
Supported Operations: **Export Map**

Wish that’s helpful.

Regards,

Ethan
