Comments (2)
Hi you can use the following code:
let myCustomClient =
let client = new HttpClient(new HttpClientHandler())
//timeout set to 5 min
client.Timeout <- TimeSpan.FromMinutes(5.0)
client.DefaultRequestHeaders.Clear()
client
...
let! req = Request.createWithClient myCustomClient Get <| Uri(url)
from http.fs.
Thanks. That works. But because of:
"Starting with .NET Core 2.1, the System.Net.Http.SocketsHttpHandler class instead of HttpClientHandler provides the implementation used by higher-level HTTP networking APIs."
I decided to do this instead:
let myCustomClient =
let client = new HttpClient()
client.Timeout <- System.Threading.Timeout.InfiniteTimeSpan
client.DefaultRequestHeaders.Clear()
client
Since I am writing a .Net Core 2.1 program and you weren't modifying anything on HttpClientHandler anyway. And that way I get all the benefits of the new SocketsHttpHandler class.
from http.fs.
Related Issues (20)
- StreamContent bodies
- Beginner question: How to correctly download large files HOT 2
- Resource temporarily unavailable HOT 3
- Update FAQ to indicate using HttpClient not HttpWebRequest/Response under the hood HOT 1
- Question re. GZip and Decompression HOT 1
- How would I determine content-length, content-type, etc without actually downloading the file? HOT 4
- README corrections
- content-type header is not sent with GET request HOT 10
- Custom http method HOT 1
- Send body from stream HOT 1
- Setting Content Headers in requests HOT 2
- How to ignore TLS Certificate errors HOT 1
- Body not sent with DELETE request HOT 2
- Add request header If-Unmodified-Since HOT 2
- Exception thrown from Hopac HOT 5
- Can't get proxy working HOT 3
- How to enable TCP Keep Alive HOT 1
- Latest package version is compiled with .NET Core-based String.split overload making it incompatible with .NET Framework and .NET Standard 2.0 HOT 6
- Docs outdated? HOT 1
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 http.fs.