Skip to content
No description or website provided.
Branch: master
Clone or download
Latest commit 9734961 Apr 25, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
art Add files via upload Apr 27, 2018
src [CF] xml documentation Apr 24, 2019
.gitattributes This is the reason I hate creating projects in VS for mac. Apr 9, 2018
.gitignore [CF] stupid backup files Apr 25, 2018
LICENSE various other cleanups Mar 24, 2019
README.md Updated readme and sample Apr 22, 2019

README.md

HttpTracer

A simple http tracing library to write request and response information to your output window. Making your life easier when debugging http calls!

Channel Status
Build Build status
MyGet.org #
NuGet.org #

Platform Support

Http Tracer is a .NET Standard 2.0 library.

Platform Version
Xamarin.iOS iOS 7+
Xamarin.Android API 14+
Windows 10 UWP 10.0.16299+
.NET Core 2.0+
ASP.NET Core 2.0+
.NET 4.6.1+

Getting Started

It is really easy to start using and debugging your Http requests, just add a instance of HttpTracerHandler to your HttpClient creation and start picking up the traces in your Visual Studio console window.

using HttpTracer;
public async Task GetMyData()
{
    var tracer = new HttpTracerHandler();
    tracer.Verbosity = LogLevel.Information;
    var client = new HttpClient(tracer);
    var result = await client.GetAsync("http://myserviceurl.com");
}

If you happen to use custom Http Handlers in your project, we suggest you use our Http handler builder:

using HttpTracer;
public async Task GetMyData()
{
    var builder = new HttpHandlerBuilder();

    builder.AddHandler(new MyHandler3())
           .AddHandler(new MyHandler2())
           .AddHandler(new MyHandler1());
           
    var tracer = builder.Build();
    tracer.Verbosity = LogLevel.Information;
    
    var client = new HttpClient(tracer);
    var result = await client.GetAsync("http://myserviceurl.com");
}

You can use bitwise operators to combine your desired HttpMessagePart options:

private const HttpMessageParts DefaultHttpTracerVerbosity =
            HttpMessageParts.RequestAll | HttpMessageParts.ResponseHeaders;

You can set the verbosity for all of your HttpTracerHandler instances by setting HttpTracerHandler.DefaultVerbosity. To set verbosity at the per-instance level, use HttpTracerHandler.Verbosity which will override HttpTracerHandler.DefaultVerbosity.

License

Under MIT (see license file)

Want To Support This Project?

All we ask is to be active by submitting bugs, features, and sending those pull requests down!

You can’t perform that action at this time.