Skip to content

Commit

Permalink
DELETE support added.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Bitounis committed Aug 23, 2022
1 parent b787247 commit a74dc5e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ProjectGuid>{E2CEBBAF-6DF7-41E9-815D-9AD4CF90C845}</ProjectGuid>
<Version>1.0.8</Version>
<Version>1.0.9</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Projects/AWSRedrive.console/AWSRedrive.console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<Version>1.0.8</Version>
<Version>1.0.9</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Projects/AWSRedrive/AWSRedrive.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ProjectGuid>{E2CEBBAF-6DF7-41E9-815D-9AD4CF90C844}</ProjectGuid>
<Version>1.0.8</Version>
<Version>1.0.9</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions Projects/AWSRedrive/ConfigurationEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class ConfigurationEntry
public bool Active { get; set; }
public bool UsePUT { get; set; }
public bool UseGET { get; set; }
public bool UseDelete { get; set; }
public int? Timeout { get; set; }
public bool IgnoreCertificateErrors { get; set; }
public string ServiceUrl { get; set; }
Expand Down
6 changes: 3 additions & 3 deletions Projects/AWSRedrive/HttpMessageProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void ProcessMessage(string message, Dictionary<string, string> attributes
private RestRequest CreateRequest(string message, Uri uri, ConfigurationEntry configurationEntry)
{
return !configurationEntry.UseGET
? CreatePostOrPutRequest(message, uri, configurationEntry)
? CreatePostOrPutOrDeleteRequest(message, uri, configurationEntry)
: CreateGetRequest(message, uri);
}

Expand All @@ -59,9 +59,9 @@ private RestRequest CreateGetRequest(string message, Uri uri)
return request;
}

private RestRequest CreatePostOrPutRequest(string message, Uri uri, ConfigurationEntry configurationEntry)
private RestRequest CreatePostOrPutOrDeleteRequest(string message, Uri uri, ConfigurationEntry configurationEntry)
{
var request = new RestRequest(uri.PathAndQuery, configurationEntry.UsePUT ? Method.Put : Method.Post);
var request = new RestRequest(uri.PathAndQuery, configurationEntry.UseDelete ? Method.Delete : configurationEntry.UsePUT ? Method.Put : Method.Post);

request.AddStringBody(message, DataFormat.Json);

Expand Down

0 comments on commit a74dc5e

Please sign in to comment.