
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
TheNevix.Utils.RequestHandler
Advanced tools
A simple and flexible NuGet-package for easily managing HTTP requests in your .NET projects. Provides features for making GET, POST, and other HTTP requests with support for custom headers, response validation, error handling and more. Compatible with .NET 6.0 to .NET 8.0.
A simple and flexible NuGet-package for easily managing HTTP requests in your .NET projects. Provides features for making GET, POST, and other HTTP requests with support for custom headers, response validation, error handling and more. Compatible with .NET 6.0 to .NET 8.0.
This documentation has been updated since version 1.2.1 and is only relevant since version 1.2.0. Before that version, syntax might slightly differ.
You can install the package via NuGet Package Manager, .NET CLI, or by adding it to your project file.
Install-Package TheNevix.Utils.RequestHandler
Enable the RequestHandler in your program.cs file.
builder.Services.AddRequestHandlerServices();
This example shows how to send an HTTP request and manage the response manually.
public class SomeService
{
private readonly IRequestHandler _requestHandler;
public SomeService(IRequestHandler requestHandler)
{
_requestHandler = requestHandler;
}
public async Task DoSomethingAsync(string url)
{
var response = await _requestHandler
.GetRequest("https://www.freetogame.com/api/games")
.ExecuteAsync();
response.EnsureSuccessStatusCode();
var jsonResponseBody = await response.Content.ReadAsStringAsync();
var data = JsonConvert.DeserializeObject<List<SimpleExecuteAsync>>(jsonResponseBody);
}
}
class SimpleExecuteAsync
{
public string Title { get; set; }
public string Genre { get; set; }
}
In this example, you receive an HttpResponseMessage object. You can then check the status code, deserialize the response body, and handle the data accordingly.
The possible HTTP methods are:
This example demonstrates how to send an HTTP request and let the library convert the JSON response into a provided response model.
public class SomeService
{
private readonly IRequestHandler _requestHandler;
public SomeService(IRequestHandler requestHandler)
{
_requestHandler = requestHandler;
}
public async Task DoSomethingAsync(string url)
{
var response = await requestHandler
.GetRequest("https://www.freetogame.com/api/games")
.ExecuteAsync<List<ExecuteAsyncWithResponseModel>>();
}
}
class ExecuteAsyncWithResponseModel
{
public string Title { get; set; }
public string Genre { get; set; }
}
Here, the response is automatically deserialized into the specified TResponse model. Remember to handle any potential exceptions, especially deserialization errors.
This example shows how to send an HTTP request where the library not only converts the JSON response into a provided response model but also checks for errors. If an error occurs, the IsSuccess property will be false.
public class SomeService
{
private readonly IRequestHandler _requestHandler;
public SomeService(IRequestHandler requestHandler)
{
_requestHandler = requestHandler;
}
public async Task DoSomethingAsync(string url)
{
var response = await requestHandler
.GetRequest("https://www.freetogame.com/api/games")
.ExecuteWithHandlingAsync<ResponseModel, List<GamesData>>();
if (!response.IsSuccess)
{
//Handle an error
}
}
}
class ResponseModel : IResponseModel<List<GamesData>>
{
public List<GamesData> Data { get; set; }
public bool IsSuccess { get; set ; }
public string? Message { get ; set ; }
public int StatusCode { get; set; }
}
class GamesData
{
public string Title { get; set; }
public string Genre { get; set; }
}
In this case, the library handles the response and error checking for you. You can easily determine if the request was successful by checking the IsSuccess property.
This project is licensed under the MIT License.
This documentation used the free freetogame api to showcase this package.
You can check them out at: https://www.freetogame.com/
FAQs
A simple and flexible NuGet-package for easily managing HTTP requests in your .NET projects. Provides features for making GET, POST, and other HTTP requests with support for custom headers, response validation, error handling and more. Compatible with .NET 6.0 to .NET 8.0.
We found that thenevix.utils.requesthandler demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.