UriBuilderExtension 1.0.0

Extension for the .net UriBuilder to simply extend the query

Install-Package UriBuilderExtension -Version 1.0.0
dotnet add package UriBuilderExtension --version 1.0.0
<PackageReference Include="UriBuilderExtension" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add UriBuilderExtension --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

UriBuilderExtensions

NuGet version (UriBuilderExtension)

Extension for the .net UriBuilder to simply extend the query

Basics:

  • Add the nuget Package to your Project
  • Add Using eg. using UriBuilderExtension;

Usage


To add a query parameter use the method `SetQueryParam``

UriBuilder uriBuilder = new UriBuilder();
           uriBuilder.Scheme = "https";
           uriBuilder.Host = "www.google.com";
           uriBuilder.Path = "search";
           // The magic happens here  
           uriBuilder.SetQueryParam("q", "query+goes+here");
           // or 
           uriBuilder.SetQueryParam("p", new String[] {"here" ,"and+here"});

If you want to check is a parameter exsit in the query use

bool exsists = uriBuilder.HasQueryParam("p")

To get the value/values of a parameter use

var value = uriBuilder.GetQueryParamValue("p")

To get all parameter keys of the query use

var value = uriBuilder.GetQueryParamKeys();

To Remove one parameter use

uriBuilder.RemoveQueryParam("q");

UriBuilderExtensions

NuGet version (UriBuilderExtension)

Extension for the .net UriBuilder to simply extend the query

Basics:

  • Add the nuget Package to your Project
  • Add Using eg. using UriBuilderExtension;

Usage


To add a query parameter use the method `SetQueryParam``

UriBuilder uriBuilder = new UriBuilder();
           uriBuilder.Scheme = "https";
           uriBuilder.Host = "www.google.com";
           uriBuilder.Path = "search";
           // The magic happens here  
           uriBuilder.SetQueryParam("q", "query+goes+here");
           // or 
           uriBuilder.SetQueryParam("p", new String[] {"here" ,"and+here"});

If you want to check is a parameter exsit in the query use

bool exsists = uriBuilder.HasQueryParam("p")

To get the value/values of a parameter use

var value = uriBuilder.GetQueryParamValue("p")

To get all parameter keys of the query use

var value = uriBuilder.GetQueryParamKeys();

To Remove one parameter use

uriBuilder.RemoveQueryParam("q");

  • .NETStandard 2.0

    • No dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 259 5/12/2018
0.1.0 214 5/8/2018