I am just beginner for Google Analytic API.
Now i am testing this code.
public static string HttpGetRequest(string url, string[] headers)
{
String result;
WebRequest request = WebRequest.Create(url);
if (headers.Length > 0)
{
foreach (var header in headers)
{
request.Headers.Add(header);
}
}
WebResponse response = request.GetResponse();
using (var sr = new StreamReader(response.GetResponseStream()))
{
result = sr.ReadToEnd();
sr.Close();
}
return result;
}
Upper code run correctly when URL value is
And then this upper code return correct information.
But when i change URL value to
It give this error.
The remote server returned an error: (400) Bad Request.
The only thing differences between these two URL is ga:pagePath.
Please let me know how could I avoid these error. Any kind of suggestion is appreciated.