Example #1
0
 static protected string GetFieldName(QueryValues which)
 {
     return("fld_" + which.ToString());
 }
Example #2
0
        public WebRequestParameter CreateWebRequest(TwitchAPIRequest apiRequest)
        {
            var baseUri     = this.GetBaseUri(apiRequest.BaseUrl, apiRequest.Version, apiRequest.Path);
            var queryValues = new QueryValues();

            queryValues.AddRange(QueryValues.Parse(baseUri.Query));
            queryValues.AddRange(apiRequest.QueryValues);

            var request = new WebRequestParameter();

            request.RetryCount     = 0;
            request.Uri            = $"{baseUri.Scheme}{Uri.SchemeDelimiter}{baseUri.Host}{baseUri.LocalPath}{queryValues.ToString(false)}";
            request.Method         = apiRequest.Method;
            request.WriteParameter = apiRequest.PostData;
            request.ContentType    = apiRequest.ContentType ?? request.ContentType;
            this.SetupRequest(request, apiRequest.Version);

            return(request);
        }