diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-09-02 22:30:05 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-09-02 22:30:05 -0400 |
| commit | a3d553a7fbe93fe416c940e80d5e511a2d753f25 (patch) | |
| tree | 1f26819204392827767875ee56bc46607948b264 /MediaBrowser.Common/Net/HttpRequestOptions.cs | |
| parent | 6fd05670ac352d69a7044f5ebe9a2c5c9f1d76cf (diff) | |
set connect access token
Diffstat (limited to 'MediaBrowser.Common/Net/HttpRequestOptions.cs')
| -rw-r--r-- | MediaBrowser.Common/Net/HttpRequestOptions.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/MediaBrowser.Common/Net/HttpRequestOptions.cs b/MediaBrowser.Common/Net/HttpRequestOptions.cs index a2b42dedb..97da49318 100644 --- a/MediaBrowser.Common/Net/HttpRequestOptions.cs +++ b/MediaBrowser.Common/Net/HttpRequestOptions.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Threading; namespace MediaBrowser.Common.Net @@ -111,5 +112,14 @@ namespace MediaBrowser.Common.Net LogRequest = true; } + + public void SetPostData(IDictionary<string,string> values) + { + var strings = values.Keys.Select(key => string.Format("{0}={1}", key, values[key])); + var postContent = string.Join("&", strings.ToArray()); + + RequestContent = postContent; + RequestContentType = "application/x-www-form-urlencoded"; + } } } |
