RestFilter Class

The RestFilter class holds pre-filter and post-filter delegates for the REST request.


Properties

PropertyProperty valueDescription
RestFilter.OperationRestHandlerOpCodeThe Operation property contains unique ID of the REST resource or operation.
RestFilter.PreFilterRESTPreFilterHandlerThe PreFilter delegate must be called before calling intercepted HandleRESTRequest.
RestFilter.PostFilterRESTPostFilterHandlerThe PostFilter delegate must be called after calling intercepted HandleRESTRequest.

RestFilter.Operation Property

The Operation property contains unique ID of the REST resource or operation.

RestFilter.PreFilter Property

The PreFilter delegate must be called before calling intercepted HandleRESTRequest. It modifies REST request input.

Usage: This example shows simple pre-filter method.

1
2
3
4
5
6
7
8
    private static RestRequestParameters PreFilterExport ( RestRequestParameters restInput )
    {
      JavaScriptSerializer sr = new JavaScriptSerializer { MaxJsonLength = int.MaxValue };
      var operationInputJson = sr.DeserializeObject(restInput.OperationInput) as IDictionary<string, object>;
      operationInputJson["layers"] = "show:" + String.Join(",", _authorizedLayerSet);
      restInput.OperationInput = sr.Serialize(operationInputJson);
      return restInput;
    }

RestFilter.PostFilter Property

The PostFilter delegate must be called after calling intercepted HandleRESTRequest. It modifies REST handler response.

Usage: This example shows simple post-filter method.

1
2
3
4
5
6
    private byte[] PostFilterRootLegend ( RestRequestParameters restInput, byte[] originalResponse )
    {
      if (null == _authorizedLayerSet)
         return null;
      return MyCustomLegend(restInput, originalResponse);
    }

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close