CSharpAnalytics.Network.BackgroundHttpWebRequester.CreateRequest C# (CSharp) Method

CreateRequest() static private method

Creates the HttpWebRequest for a URI taking into consideration the length. For URIs over 2000 bytes it will be a GET otherwise it will become a POST with the query payload moved to the POST body.
static private CreateRequest ( Uri requestUri, bool writePostBody = true ) : HttpWebRequest
requestUri System.Uri URI to request.
writePostBody bool Whether to open the http request and write the POST body.
return System.Net.HttpWebRequest
        internal static HttpWebRequest CreateRequest(Uri requestUri, bool writePostBody = true)
        {
            return ShouldUsePostForRequest(requestUri)
                       ? CreatePostRequest(requestUri, writePostBody)
                       : CreateGetRequest(requestUri);
        }