HTTP


HTTP post file from .NET Core new HTTP client

Now with .NET Core 3, Microsoft released a new .NET Core HTTP client. Reference: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/http-requests?view=aspnetcore-3.1 With the new client, to call a WEB API is much easier. For example, to make an HTTP GET request: var request = new HttpRequestMessage(HttpMethod.Get, url) { Content = new …


Limit ASP.NET Core request frequency by IP address

By default, the user can request an ASP.NET Core web server unlimitedly. The user may request our web server very frequently and submit lots of spam data. Also, too frequent requests may be a terrible attack which may cost our service down and lots of money. So how can we group the requests by their IP address, limit the frequency of the user requests, and return an error message? There's …