Skip to content

Commit 72bad0d

Browse files
committed
Merge branch 'release/1.4.1'
2 parents 42e21d5 + 4223b81 commit 72bad0d

File tree

6 files changed

+25
-15
lines changed

6 files changed

+25
-15
lines changed

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2020 Gregor Mohorko
189+
Copyright 2023 Gregor Mohorko
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ YourClass response = request.Call("TestAction");
4545

4646
Gregor Mohorko ([www.mohorko.info](https://www.mohorko.info))
4747

48-
Copyright (c) 2020 Gregor Mohorko
48+
Copyright (c) 2023 Gregor Mohorko
4949

5050
[Apache License 2.0](./LICENSE.md)

src/BlueWSClient.NET/BlueWSClient.NET.Test/BlueWSClient.NET.Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
<Reference Include="GM.Utility, Version=1.4.2.0, Culture=neutral, PublicKeyToken=a1ae152199607549, processorArchitecture=MSIL">
3838
<HintPath>..\packages\GM.Utility.1.4.2\lib\netstandard2.0\GM.Utility.dll</HintPath>
3939
</Reference>
40-
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
41-
<HintPath>..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
40+
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
41+
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
4242
</Reference>
4343
<Reference Include="System" />
4444
<Reference Include="System.Core" />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="GM.Utility" version="1.4.2" targetFramework="net48" />
4-
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net461" />
4+
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
55
</packages>

src/BlueWSClient.NET/BlueWSClient.NET/BlueWSClient.NET.csproj

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,19 @@
77
<SignAssembly>true</SignAssembly>
88
<DelaySign>false</DelaySign>
99
<AssemblyOriginatorKeyFile>GM.StrongNameKey.snk</AssemblyOriginatorKeyFile>
10-
<Version>1.4.0.0</Version>
11-
<AssemblyVersion>1.4.0.0</AssemblyVersion>
12-
<FileVersion>1.4.0.0</FileVersion>
10+
<Version>1.4.1.0</Version>
11+
<AssemblyVersion>1.4.1.0</AssemblyVersion>
12+
<FileVersion>1.4.1.0</FileVersion>
1313
<Title>BlueWS</Title>
1414
<Authors>Gregor Mohorko</Authors>
1515
<Company>Gregor Mohorko</Company>
1616
<PackageProjectUrl>https://github.com/GregaMohorko/BlueWSClient.NET</PackageProjectUrl>
1717
<PackageIcon>BlueWS Icon.png</PackageIcon>
1818
<PackageTags>EntityFramework Entity Database JSON Criteria Expression TableInheritance ManyToOne OneToMany ManyToMany MySQL</PackageTags>
1919
<Description>A client library for BlueWS library. Includes logic and utility for calling BlueWS web service actions.</Description>
20-
<Copyright>Copyright © Grega Mohorko 2022</Copyright>
20+
<Copyright>Copyright © Grega Mohorko 2023</Copyright>
2121
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
22-
<PackageReleaseNotes>Remove obsolete things.
23-
Add ability to specify custom http client.</PackageReleaseNotes>
22+
<PackageReleaseNotes>Fix usage with latest GM.Utility package.</PackageReleaseNotes>
2423
<RepositoryUrl>https://github.com/GregaMohorko/BlueWSClient.NET</RepositoryUrl>
2524
<RepositoryType>Git</RepositoryType>
2625
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
@@ -30,7 +29,7 @@ Add ability to specify custom http client.</PackageReleaseNotes>
3029
</PropertyGroup>
3130

3231
<ItemGroup>
33-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
32+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
3433
</ItemGroup>
3534

3635
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
@@ -45,8 +44,8 @@ Add ability to specify custom http client.</PackageReleaseNotes>
4544
</PropertyGroup>
4645

4746
<ItemGroup>
48-
<PackageReference Include="GM.Utility" Version="1.4.2" />
49-
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
47+
<PackageReference Include="GM.Utility" Version="1.5.0" />
48+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
5049
</ItemGroup>
5150

5251
<ItemGroup>

src/BlueWSClient.NET/BlueWSClient.NET/Request.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ limitations under the License.
2626
using GM.Utility.Net;
2727
using HttpMethod = System.Net.Http.HttpMethod;
2828
using System.Threading;
29+
using System.Collections.Specialized;
30+
using System.Linq;
31+
using System.Net;
2932

3033
namespace BlueWS
3134
{
@@ -110,7 +113,15 @@ public async Task<T> CallAsync(string action, CancellationToken cancellationToke
110113
string address = WebService.ServerAddress;
111114
HttpMethod httpMethod = WebService.HttpMethod;
112115
using(var webClient = new GMHttpClient(httpClient, disposeHttpClient: httpClient == null)) {
113-
RawResponse = await webClient.UploadValuesAsync(address, data, httpMethod, cancellationToken);
116+
if(httpMethod == HttpMethod.Get) {
117+
RawResponse = await webClient.SendGet(address, data, cancellationToken).ConfigureAwait(false);
118+
} else if(httpMethod == HttpMethod.Post) {
119+
var encodedItems = data.Select(x => $"{WebUtility.UrlEncode(x.Key)}={WebUtility.UrlEncode(x.Value)}");
120+
var httpContent = new StringContent(string.Join("&", encodedItems), null, "application/x-www-form-urlencoded");
121+
RawResponse = await webClient.Send(address, HttpMethod.Post, httpContent, cancellationToken).ConfigureAwait(false);
122+
} else {
123+
throw new Exception($"HttpMethod {httpMethod} is not allowed.");
124+
}
114125
}
115126
AfterCalling();
116127
} catch(HttpRequestException) {

0 commit comments

Comments
 (0)