Skip to content

Commit 207f985

Browse files
committed
Minor fix for PingAsync
- Xamarin on Android is more particular about Content being set to anything, even empty content. Content will now remain null unless content is available and method is not GET - Moved to 1.0.4
1 parent e0930ba commit 207f985

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

samples/Example.Cli/Program.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ static async Task AsyncMain(string[] args) {
1717
ApiClient cc = new ApiClient(Environment.GetEnvironmentVariable("API_KEY"), Environment.GetEnvironmentVariable("API_SECRET"));
1818
cc.Authentication = new SessionAuthentication(Environment.GetEnvironmentVariable("SESSION_TOKEN"));
1919

20-
var q = await cc.Devices.ListDevicesAsync();
21-
var qq = await cc.Devices.ListDeviceEventsAsync(q[2].UUID);
20+
var p = await cc.PingAsync();
2221
}
2322
}
2423
}

src/WifiPlug.Api/ApiClient.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,7 @@ public Uri BaseAddress {
175175
_authentication.Apply(req);
176176

177177
// assign body
178-
if (content == null)
179-
req.Content = new StringContent("", Encoding.UTF8);
180-
else if (method != HttpMethod.Get)
178+
if (method != HttpMethod.Get)
181179
req.Content = content;
182180

183181
// send

src/WifiPlug.Api/WifiPlug.Api.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
<PackageProjectUrl>https://wifiplug.co.uk</PackageProjectUrl>
1212
<RepositoryUrl>https://github.com/wifiplug/api-client-net</RepositoryUrl>
1313
<RepositoryType>git</RepositoryType>
14-
<AssemblyVersion>0.1.0.3</AssemblyVersion>
15-
<FileVersion>0.1.0.3</FileVersion>
14+
<AssemblyVersion>0.1.0.4</AssemblyVersion>
15+
<FileVersion>0.1.0.4</FileVersion>
1616
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
1717
<PackageIconUrl>https://s3.eu-west-2.amazonaws.com/wifiplug-pub/nuget-icons/wifiplug.png</PackageIconUrl>
1818
<PackageLicenseUrl>https://github.com/wifiplug/api-client-net/blob/master/LICENSE</PackageLicenseUrl>
19-
<Version>1.0.3</Version>
19+
<Version>1.0.4</Version>
2020
</PropertyGroup>
2121

2222
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

0 commit comments

Comments
 (0)