Skip to content

Instantly share code, notes, and snippets.

@kierenj
Created March 1, 2018 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kierenj/b634258c6c3ee99c4ed1951d860a6a65 to your computer and use it in GitHub Desktop.
Save kierenj/b634258c6c3ee99c4ed1951d860a6a65 to your computer and use it in GitHub Desktop.
[HttpGet]
[Route("products")]
public IHttpActionResult GetProducts([FromUri]string filter)
{
string headerValue = null;
IEnumerable headerValues;
if (Request.Headers.TryGetValue("X-Secret-Penguin-Handshake", out headerValues))
{
headerValue = headerValues.FirstOrDefault();
}
if (string.IsNullOrEmpty(headerValue)) return BadRequest("Wenk!");
var results = RunGetProductsQuery(filter);
return Json(results);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment