Skip to content

Instantly share code, notes, and snippets.

View neehouse's full-sized avatar

Casey Neehouse neehouse

  • Best Case Technologies, LLC
  • Pittsburgh, PA
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Membership;
/*
The DelegatingHandler. Override the SendAsync method.
This will intercept all WebAPI requests. So filter for the API Endpoint you are wanting to manipulate.
*/
public class WebApiHandler : System.Net.Http.DelegatingHandler
{
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
if (request.RequestUri.AbsolutePath.ToLower() == "/umbraco/backoffice/umbracoapi/media/getchildren")