Giter VIP home page Giter VIP logo

hakuna-matata-in / aspnetcorecurlmiddlewarepackage Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 28 KB

Captures the Asp.Net Core HTTP Request and converts it as CURL file. This can be easily imported to Postman and other api testing tools

Home Page: https://github.com/hakuna-matata-in/AspNetCoreCurlMiddlewarePackage

License: Apache License 2.0

C# 100.00%
middleware csharp curl aspnetcore aspnet postman as

aspnetcorecurlmiddlewarepackage's Introduction

AspNetCore Curl Middleware Package

Captures the ASP.NETCore HTTP Request and converts it as CURL file.

.NET

Use Case

As a back-end developer we would come across with different errors during runtime across multiple environments like QA, Staging, Production etc...In the modern era of micro-services the effort that we put to reproduce the same request and test in our local system has become a tedious process. In order to reduce the effort spent in reproducing a issue we could log the HTTP Request object as a curl request and save the request as files. These files can be pulled back into Postman or any other API testing tools and can be used to reproduce the issue a lot quicker than manually framing it.

Usage

Install the package created after the build or install the package via nuget using the following command

Install-Package AspNetCoreCurlMiddleware -Version 1.0.0

in your .NET Project.

Code

Add services needed for the middleware and initialize the parameters needed for the IRequestBuilder. Add the extension methods as part of ConfigureServices and Configure method in Startup.cs

services.AddSaveAsCurlMiddlewareServices(new Middleware.Models.SaveRequestOptions { LogPath = "request", SaveRequest = true });
app.UseSaveAsCurlMiddleware();

The SaveRequestOptions carries the input parameters for the curl builder you can customize the curl builder by extending the classes for your needs.

Buy Me A Coffee

Contributions

Contributions & ideas for extending the projects are welcome.

aspnetcorecurlmiddlewarepackage's People

Contributors

hakuna-matata-in avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.