diff --git a/Moesif.Api.Test/ControllerTestBase.cs b/Moesif.Api.Test/ControllerTestBase.cs index cf6af4d..693e019 100644 --- a/Moesif.Api.Test/ControllerTestBase.cs +++ b/Moesif.Api.Test/ControllerTestBase.cs @@ -44,7 +44,7 @@ public static MoesifApiClient GetClient() { if (client == null) { - client = new MoesifApiClient("Your Moesif Application Id"); + client = new MoesifApiClient("Your Moesif Application Id", null, false); } return client; } diff --git a/Moesif.Api/Configuration.cs b/Moesif.Api/Configuration.cs index 248fc3d..e9de7fd 100644 --- a/Moesif.Api/Configuration.cs +++ b/Moesif.Api/Configuration.cs @@ -16,5 +16,9 @@ public partial class Configuration //TODO: Replace the ApplicationId with your own public static string ApplicationId = "SET_ME"; + public static string UserAgentString = null; + + public static bool Debug = false; + } } \ No newline at end of file diff --git a/Moesif.Api/Controllers/ApiController.cs b/Moesif.Api/Controllers/ApiController.cs index a7ba17c..750ef17 100644 --- a/Moesif.Api/Controllers/ApiController.cs +++ b/Moesif.Api/Controllers/ApiController.cs @@ -223,6 +223,24 @@ public async Task> CreateEventsBatchAsync(List> CreateEventsBatchAsync(List headers = request.Headers.ToDictionary(item=> item.Key,item=> (Object) item.Value); uniRequest.headers(headers); - uniRequest.header("user-agent", "moesifapi-csharp/" + Version); + if (Configuration.UserAgentString != null) + { + uniRequest.header("user-agent", Configuration.UserAgentString); + } + else + { + uniRequest.header("user-agent", "moesifapi-csharp/" + Version); + } //Set basic auth credentials if any if (!string.IsNullOrWhiteSpace(request.Username)) diff --git a/Moesif.Api/Moesif.Api.nuspec b/Moesif.Api/Moesif.Api.nuspec index bd44e29..4307f2d 100644 --- a/Moesif.Api/Moesif.Api.nuspec +++ b/Moesif.Api/Moesif.Api.nuspec @@ -2,7 +2,7 @@ Moesif.Api - 2.0.2 + 2.0.3 MoesifApi Moesif Moesif diff --git a/Moesif.Api/MoesifApiClient.cs b/Moesif.Api/MoesifApiClient.cs index f9a4173..caf9caa 100644 --- a/Moesif.Api/MoesifApiClient.cs +++ b/Moesif.Api/MoesifApiClient.cs @@ -57,9 +57,11 @@ private MoesifApiClient() { } /// /// Client initialization constructor /// - public MoesifApiClient(string applicationId) + public MoesifApiClient(string applicationId, string userAgentString = null, bool debug = false) { Configuration.ApplicationId = applicationId; + Configuration.UserAgentString = userAgentString; + Configuration.Debug = debug; } } } \ No newline at end of file diff --git a/Moesif.Api/Properties/AssemblyInfo.cs b/Moesif.Api/Properties/AssemblyInfo.cs index 9d0d11e..51cc40a 100644 --- a/Moesif.Api/Properties/AssemblyInfo.cs +++ b/Moesif.Api/Properties/AssemblyInfo.cs @@ -23,5 +23,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.2")] -[assembly: AssemblyFileVersion("2.0.2")] +[assembly: AssemblyVersion("2.0.3")] +[assembly: AssemblyFileVersion("2.0.3")]