📜 ⬆️ ⬇️

Rake with WebRequest

I started to learn the Google Data API and encountered the problem that the first authorization request takes a very long time: 5-10 seconds, although subsequent requests pass quickly.
And the examples for the Google Data API work the same way. I thought it was some kind of tricky defense, but everything turned out to be quite simple.
WebRequest before the first request tries to automatically determine the proxy settings - this takes time.
Autodetection of a proxy can be disabled by adding a session to app.config:
< system.net >
< defaultProxy enabled ="false" />
</ system.net >


* This source code was highlighted with Source Code Highlighter .

Or more cruelly, writing after creating a webRequest: a webRequest.Proxy = null; .

')

Source: https://habr.com/ru/post/85117/


All Articles