Пример #1
0
        /// <summary>
        ///     Resets the headers to make any request to the Nexon Api look legit
        /// </summary>
        /// <param name="headers">The <see cref="HttpRequestHeaderCollection" /> that gets modified</param>
        private static void SetHeaders(HttpRequestHeaders headers)
        {
            headers.Clear();

            headers.Accept.ParseAdd("application/json, text/javascript, */*; q=0.01");
            headers.AcceptEncoding.ParseAdd("gzip,deflate");
            headers.AcceptLanguage.ParseAdd("en-GB,en-us;q=0.8,en;q=0.6");
            headers.UserAgent.ParseAdd(GetUserAgent);
            headers.Connection.TryParseAdd("keep-alive");
            headers.Host = new Uri(LoginUrl).Host;
            headers.Add("X-Requested-With", "XMLHttpRequest");
        }