micro-elements - MicroElements.FluentProxy 0.7.1
Simple http proxy to use in front of real services. Use it for tracing blackboxes and for mocking responses.
PM> Install-Package MicroElements.FluentProxy -Version 0.7.1 -Source https://www.myget.org/F/micro-elements/api/v3/index.json
> nuget.exe install MicroElements.FluentProxy -Version 0.7.1 -Source https://www.myget.org/F/micro-elements/api/v3/index.json
> dotnet add package MicroElements.FluentProxy --version 0.7.1 --source https://www.myget.org/F/micro-elements/api/v3/index.json
source https://www.myget.org/F/micro-elements/api/v3/index.json
nuget MicroElements.FluentProxy ~> 0.7.1
Copy to clipboard
> choco install MicroElements.FluentProxy --version 0.7.1 --source https://www.myget.org/F/micro-elements/api/v2
Import-Module PowerShellGet
Register-PSRepository -Name "micro-elements" -SourceLocation "https://www.myget.org/F/micro-elements/api/v2"
Install-Module -Name "MicroElements.FluentProxy" -RequiredVersion "0.7.1" -Repository "micro-elements"
Copy to clipboard
MicroElements.FluentProxy
Simple http proxy to use in front of real services. Use it for tracing blackboxes and for mocking responses.
WARNING: version before 1.0.0 has unstable API. After stabilizing this warning will be removed!
Statuses
Installation
Package Reference:
dotnet add package MicroElements.FluentProxy
Usage
var settings = new FluentProxySettings
{
ExternalUrl = new Uri("https://api.github.com"),
OnRequestFinished = session =>
{
Console.WriteLine(session.RequestUrl);
Console.WriteLine(session.ResponseData.ResponseContent);
}
};
FluentProxyServer fluentProxyServer = await FluentProxyFactory.CreateServer(settings);
var request = new HttpRequestMessage(HttpMethod.Get, "/repos/aspnet/docs/branches");
request.Headers.Add("Accept", "application/vnd.github.v3+json");
request.Headers.Add("User-Agent", "HttpClientFactory-Sample");
HttpClient httpClient = fluentProxyServer.GetHttpClient();
var httpResponseMessage = await httpClient.SendAsync(request);
var response = await httpResponseMessage.Content.ReadAsStringAsync();
Build
Windows: Run build.ps1
Linux: Run build.sh
License
This project is licensed under the MIT license. See the LICENSE file for more info.
0.7.1
- Fixed : StatusCode cannot be set because the response has already started.
0.7.0
- Change: Headers in RequestSession and ResponseData changed type to Dictionary because AspNetCore clears cached IHeaderDictionary
0.6.1
- Fixed: Copy headers to response from cached data
0.6.0
- Changed: ExternalUrl changed type to Uri
- Added ProxyUrl: Uri
- Added comments and minor fixes
0.5.0
- bugfixes
- Removed properties from RequestSession in favor of ResponseData
0.4.0
FluentProxyLogMessagesplitted toRequestSessionandResponseDataGetMockedResponserenamed toGetCachedResponseand returnsResponseData- Added ids to
RequestSessionandResponseData
0.3.0
GetMockedResponseworks now withFluentProxyLogMessage
0.2.1
- bugfixes
0.2.0
- Extended settings and request processing
0.1.0
- Initial version
Full release notes can be found at: https://github.com/micro-elements/MicroElements.FluentProxy/blob/master/CHANGELOG.md
- .NETStandard 2.0: 2.0.0.0
OwnersAlexey Petryashev |
Authorsalexey.petriashev, MicroElements |
Project URLhttps://github.com/micro-elements/MicroElements.FluentProxy |
LicenseMIT |
Tagsaspnetcore proxy http mock wiremock http cache httpcache tracing |
Info106 total downloads |
| 11 downloads for version 0.7.1 |
| Download (18.02 KB) |
| Found on the current feed only |
Package history
| Version | Size | Last updated | Downloads | Mirrored? | |||
|---|---|---|---|---|---|---|---|
|
0.7.1 | 18.02 KB | Mon, 08 Oct 2018 14:12:29 GMT | 11 |
|
||
|
0.7.0 | 18.04 KB | Thu, 04 Oct 2018 15:56:07 GMT | 9 |
|
||
|
0.6.1 | 17.58 KB | Wed, 03 Oct 2018 15:19:54 GMT | 9 |
|
||
|
0.6.0 | 17.46 KB | Sun, 30 Sep 2018 21:47:11 GMT | 11 |
|
||
|
0.5.0 | 15.87 KB | Thu, 20 Sep 2018 06:40:27 GMT | 8 |
|
||
|
0.4.1 | 15.95 KB | Wed, 19 Sep 2018 10:00:27 GMT | 10 |
|
||
|
0.4.0 | 15.95 KB | Wed, 19 Sep 2018 09:54:04 GMT | 8 |
|
||
|
0.3.0 | 14.36 KB | Tue, 18 Sep 2018 15:52:49 GMT | 10 |
|
||
|
0.2.1 | 13.91 KB | Tue, 18 Sep 2018 12:24:08 GMT | 10 |
|
||
|
0.2.0 | 13.84 KB | Mon, 17 Sep 2018 21:58:47 GMT | 10 |
|
||
|
0.1.0 | 12.22 KB | Sun, 16 Sep 2018 21:21:29 GMT | 10 |
|