wasSharp – Diff between revs 48 and 54
?pathlinks?
Rev 48 | Rev 54 | |||
---|---|---|---|---|
Line 37... | Line 37... | |||
37 | public wasHTTPClient(ProductInfoHeaderValue userAgent, string mediaType) |
37 | public wasHTTPClient(ProductInfoHeaderValue userAgent, string mediaType) |
|
38 | : this(userAgent, new CookieContainer(), mediaType, null, null, 60000) |
38 | : this(userAgent, new CookieContainer(), mediaType, null, null, 60000) |
|
39 | { |
39 | { |
|
40 | } |
40 | } |
|
Line -... | Line 41... | |||
- | 41 | |
||
- | 42 | public wasHTTPClient(ProductInfoHeaderValue userAgent, CookieContainer cookieContainer, string mediaType) |
||
- | 43 | : this(userAgent, new CookieContainer(), mediaType, null, null, 60000) |
||
- | 44 | { |
||
- | 45 | } |
||
41 | |
46 | |
|
42 | public wasHTTPClient(ProductInfoHeaderValue userAgent, CookieContainer cookieContainer, string mediaType, |
47 | public wasHTTPClient(ProductInfoHeaderValue userAgent, CookieContainer cookieContainer, string mediaType, |
|
43 | AuthenticationHeaderValue authentication, Dictionary<string, string> headers, uint timeout) |
48 | AuthenticationHeaderValue authentication, Dictionary<string, string> headers, uint timeout) |
|
44 | { |
49 | { |
|
45 | var HTTPClientHandler = new HttpClientHandler |
50 | var HTTPClientHandler = new HttpClientHandler |
|
Line 89... | Line 94... | |||
89 | } |
94 | } |
|
90 | HTTPClient.Timeout = TimeSpan.FromMilliseconds(timeout); |
95 | HTTPClient.Timeout = TimeSpan.FromMilliseconds(timeout); |
|
91 | MediaType = mediaType; |
96 | MediaType = mediaType; |
|
92 | } |
97 | } |
|
Line 93... | Line -... | |||
93 | |
- | ||
94 | public void Dispose() |
- | ||
95 | { |
- | ||
96 | HTTPClient?.Dispose(); |
- | ||
97 | HTTPClient = null; |
- | ||
98 | } |
- | ||
99 | |
98 | |
|
100 | /////////////////////////////////////////////////////////////////////////// |
99 | /////////////////////////////////////////////////////////////////////////// |
|
101 | // Copyright (C) 2014 Wizardry and Steamworks - License: GNU GPLv3 // |
100 | // Copyright (C) 2014 Wizardry and Steamworks - License: GNU GPLv3 // |
|
102 | /////////////////////////////////////////////////////////////////////////// |
101 | /////////////////////////////////////////////////////////////////////////// |
|
103 | /// <summary> |
102 | /// <summary> |
|
Line 479... | Line 478... | |||
479 | } |
478 | } |
|
480 | catch (Exception) |
479 | catch (Exception) |
|
481 | { |
480 | { |
|
482 | return null; |
481 | return null; |
|
483 | } |
482 | } |
|
484 | } |
483 | } |
|
- | 484 | |
||
- | 485 | public void Dispose() |
||
- | 486 | { |
||
- | 487 | ((IDisposable)HTTPClient).Dispose(); |
||
- | 488 | } |
||
485 | } |
489 | } |
|
486 | } |
490 | } |