fsprojects / fsprojects/FsHttp
Question: Chaos testing with Polly (different HttpClient)
Nobody has claimed this yet.
- Dominant language
- F#
- Stars
- 498
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Description
Description:
Hello, hope you're good. I'm currently reading this article from Microsoft and trying to replicate it with F#. I'm able to extract the HttpClient from the HttpContext, but I'm not sure how to pass it to the FsHttp to use.
For example, I have a function that receives the HttpContext's (httpClient: HttpClient) as parameter, with the chaos engineering configuration:
http {
config_setHttpClientFactory (fun _config -> httpClient)
GET serviceURL
AuthorizationUserPw user passw
}
Is this the right way to use it? I was +/- inspired by this test scenario: https://github.com/fsprojects/FsHttp/blob/master/src/Tests/DotNetHttp.fs.
Edit:
It's missing something, because when I try to run this request using the different httpClient it does not work properly.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/Tests/DotNetHttp.fs and the config_setHttpClientFactory usage shown in the issue, then compare it with the linked Polly chaos-testing article. Reproduce the request using the HttpContext HttpClient and determine what prevents the configured client from being used; done means the request works through the supplied client and the scenario is covered by a test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fsharp
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100