Skip to content

Commit

Permalink
Merge pull request #4 from dlmelendez/rel/2.0
Browse files Browse the repository at this point in the history
Removing .netstandard, adding ExecuteRaw http responses
  • Loading branch information
dlmelendez committed Apr 10, 2023
2 parents 1ee35a8 + 5305500 commit 8326a33
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion PayPalHttp-Dotnet.Tests/PayPalHttp-Dotnet.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<LangVersion>11.0</LangVersion>
<IsPackable>false</IsPackable>
<Version>1.9.0</Version>
<Version>2.0.0</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
Expand Down
19 changes: 19 additions & 0 deletions PayPalHttp-Dotnet/HttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,24 @@ public virtual async Task<HttpResponse> Execute<T>(T req) where T: HttpRequest
throw new HttpException(response.StatusCode, response.Headers, responseBody);
}
}

public virtual async Task<HttpResponseMessage> ExecuteRaw<T>(T req) where T : HttpRequest
{
var request = req.Clone<T>();

foreach (var injector in _injectors)
{
request = await injector.InjectAsync(request).ConfigureAwait(false);
}

request.RequestUri = new Uri(_environment.BaseUrl() + request.Path);

if (request.Body != null)
{
request.Content = await Encoder.SerializeRequestAsync(request).ConfigureAwait(false);
}

return await _client.SendAsync(request).ConfigureAwait(false);
}
}
}
4 changes: 2 additions & 2 deletions PayPalHttp-Dotnet/PayPalHttp-Dotnet.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<LangVersion>11.0</LangVersion>
<Title>ElCamino.PayPalHttp</Title>
<AssemblyName>ElCamino.PayPalHttp</AssemblyName>
Expand All @@ -18,7 +18,7 @@
<RepositoryUrl>https://github.com/dlmelendez/paypalhttp_dotnet.git</RepositoryUrl>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>

<Version>1.9.0</Version>
<Version>2.0.0</Version>
<PackageProjectUrl>https://github.com/dlmelendez/paypalhttp_dotnet</PackageProjectUrl>
<!--<DebugType>Full</DebugType>-->
<!-- DebugType Full is needed for test code coverage, but .nuget symbols doesn't like it-->
Expand Down

0 comments on commit 8326a33

Please sign in to comment.