Comments (7)
I've pushed up a commit with a prototype/proof-of-concept of how this might work here: martincostello@fb9440d
Let me know if this would address your use case, and if it seems workable I can look at fleshing it out.
from httpclient-interception.
Cool - glad it works for your use case.
I left out async to start with to get some fast feedback, however given the current internal design I don't know if it could be easily added or not. I'll consider it, but leave it out if it requires too much rework - it could always be added at a later date in a new major version if there's demand for it.
I'll look at circling back to this change and fleshing it out some time this week. Once I do that I'll push up a pull request, and you should be able to validate it via a preview NuGet package via the GitHub Actions CI to validate it before it goes into a release shipped to NuGet.org.
from httpclient-interception.
Thanks @martincostello.
I've tested it and it works great!
from httpclient-interception.
Thanks - I'll come back to finishing this off and prepping a release including the change next week when I'm back in the office.
from httpclient-interception.
This change is now available from NuGet.org.
from httpclient-interception.
Thanks @martincostello!
That looks perfect for my use case, and it seems like a very elegant solution. Perhaps some async overload might be useful (like there already is for WithContent
)? I don't currently need it to be async-friendly though, so it could be omitted if you don't think it's worth it.
from httpclient-interception.
See #475.
You can download the packages from the build artifacts here (packages-*
).
from httpclient-interception.
Related Issues (20)
- MissingMethodException when running on mono with newer Newtonsoft.Json HOT 13
- Allow access to CancellationToken HOT 2
- Question: How to simulate a timeout/no response from downstream service HOT 2
- request: more examples for response changing based on how many times called so far HOT 4
- Improve custom matching HOT 3
- NullReferenceException when Deregister builder with a custom matcher HOT 2
- Verify calls to the registered end points have been called [discussion] HOT 8
- Same request but with different responses HOT 4
- Add [StringSyntax] attributes HOT 2
- Remove Newtonsoft.Json
- Async RegisterBundle() overloads
- Fix remote certificate is invalid for https HOT 3
- Response sequence HOT 1
- Add exception list for urls to ignore when ThrowOnMissingRegistration is true
- Question: Should HttpClient created from HttpClientInterceptorOptions auto-follow redirects? HOT 1
- Ignore order of query params HOT 4
- after upgrade, build error HOT 4
- Test Failures Due to Authorization Issues After Upgrading to .NET 8 and HttpClient-Interception HOT 1
- Revise documentation covering usage together with IHttpClientFactory HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from httpclient-interception.