Created
March 1, 2018 14:29
-
-
Save kierenj/b634258c6c3ee99c4ed1951d860a6a65 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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