cognitedata / oryx

.NET Cross platform and highly composable middleware for building web request handlers in F#
Apache License 2.0
202 stars 10 forks source link

Error in primary documented example? #102

Closed vdksoda closed 2 years ago

vdksoda commented 2 years ago

I am starting out my F# journey and decided to try the Oryx framework as a HTTP client. I faced this issue when I copy-pasted your primary documented example.

Result: Error
  System.Exception: Must set HttpClient
   at Oryx.HttpContextModule.defaultRequest@125.Invoke(Unit unitVar0)
   at Oryx.Fetch.fetch@72-1.MoveNext()
   at Oryx.Pipeline.Core.runUnsafeAsync@35.MoveNext()
   at Oryx.Pipeline.Core.runAsync@42.MoveNext()

Here is a screenshot from Visual Studio Preview for Mac showcasing the code with the error. image

I found by moving withHttpClient client above fetch solved the problem. Is this an error or am I using the example code wrong? image

dbrattli commented 2 years ago

Thanks for submitting the issue. You are absolutely right, and we will fix this as soon as possible.