• About
  • Privacy Policy
  • Utilities
Darchuk.NET

WebAPI

ASP.NET Core Web API–Returning a FileStream

May 31, 2019 by Robert 3 Comments

So I built a service that collects information, say, log information, and sends it down to a client.  This information is normally streamed right to a web browser via SignalR, but sometimes there is a lot of it, and scrolling through it on the web view can be quite a pain.  It would be nice … [Read more…]

Posted in: .NET Core, ASP.NET, C#, Web API, Web Development Tagged: ASP.NET, C#, File Download, Stream, WebAPI

Javascript–Caching a web request with Promises

March 1, 2019 by Robert Leave a Comment

Suppose you have some data that comes from a web server somewhere.  But, it doesn’t change – so we really only need to fetch it once, and then store the result for easy access (maybe its an Enum that you map to a list of key/value pairs).  We can do this easily enough in a … [Read more…]

Posted in: Angular, JavaScript, Typescript, Web Development Tagged: Angular, Typescript, Web Development, WebAPI

.NET Core WebApp–Set Port on Command Line Launch

February 22, 2019 by Robert Leave a Comment

There are a bunch of different ways to do this, but sometimes I find myself wanting to run multiple web applications locally on different ports without fussing with configuration files, etc.  And whenever I need to do this, I always have to look it up… but most of the posts out there are how to … [Read more…]

Posted in: .NET Core, ASP.NET, Web Development Tagged: .NET, .NET Core, ASP.NET, C#, WebAPI

CORS in ASP .NET Core 2.2

December 21, 2018 by Robert Leave a Comment

Recently my team upgraded to .NET Core 2.2.  We have an API that needs to be accessed from an Angular project living in a different domain, so we had CORS enabled this way: Disclaimer: this is an intranet application – so it is only accessible inside of a corporate firewall, making it more acceptable to … [Read more…]

Posted in: .NET Core, ASP.NET, C#, Security, Web API, Web Development Tagged: .NET Core, ASP.NET, C#, CORS, NETCORE, Security, WebAPI

.NET Core MVC Controller – Supporting more HttpStatusCodes in IActionResult responses

April 6, 2018 by Robert Leave a Comment

When I’m designing a RESTful API, I like to use the correct verbs for the correct actions, and return HTTP status codes that convey the correct message.  Sure, its easy to just return a 200 OK for everything, but its a little more useful to return 204 No Content if your client shouldn’t navigate away … [Read more…]

Posted in: .NET Core, ASP.NET, C#, MVC, Web API Tagged: C#, HttpStatus, IActionResult, MVC, REST, WebAPI

Recent Posts

  • Allowing trailing JSON commas in ASP.NET Core 3
  • YADNC3JSG–Yet Another .NET Core 3.0 JSON Serializer Gotcha
  • Logging in a .NET Core 3 SignalR client
  • .NET Core 3 unit testing project sdk
  • .NET Core 3.0 Upgrade–New JSON Serializer Gotchas

Recent Comments

  1. Robert on C# Setting Socket Keep-Alive
  2. Oliver Schramm on C# Setting Socket Keep-Alive
  3. John Anderson on Waiting for a keypress asynchronously in a C# console app
  4. Ronald Garlit on .NET Core 3 unit testing project sdk
  5. Ronald Garlit on .NET Core 3 unit testing project sdk

Copyright © 2025 Darchuk.NET.

Omega WordPress Theme by ThemeHall