Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. public static class Function1
  2. {
  3. [FunctionName("EchoHeaders")]
  4. public static async Task<IActionResult> Run(
  5. [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
  6. ILogger log)
  7. {
  8. log.LogInformation("C# HTTP trigger function processed a request.");
  9.  
  10. string returnstring = "";
  11.  
  12. foreach (var header in req.Headers)
  13. {
  14. returnstring += header.Key + ":" + header.Value + "</BR>";
  15. }
  16.  
  17. string pageHTML = "<HTML><HEAD><TITLE>Header Echo test page<TITLE></HEAD><BODY><H1>Headers</H1>" + returnstring + "</HTML>";
  18.  
  19. return (ActionResult)new OkObjectResult(pageHTML);
  20.  
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement