iesmerio / google-gdata

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

Anchor tag (#) corrupts DataQuery #545

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Anchor tag (#) corrupts DataQuery as per description at 
http://stackoverflow.com/questions/7238358/google-data-api-sdk-filter-encoding-e
scaping and 
http://stackoverflow.com/questions/7657321/google-data-api-sdk-filter-encoding-e
scaping-followup
Data Feed Explorer 
(http://code.google.com/apis/analytics/docs/gdata/gdataExplorer.html) manages 
to retrieve data with # just fine.

What steps will reproduce the problem?
1. Create blank .NET project referencing Google.GData.Analytics, 
Google.Gdata.Client and Google.GData.GoogleBase
2. Construct a DataQuery with Filters parameter including "#" character. Data 
is not returned even when using HttpUtility.UrlEncode which should be used 
after "ga:filters" is given
3. Observe GDataRequestException being thrown

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
Windows 7

Please provide any additional information below.

Original issue reported on code.google.com by j...@potentiality.com.au on 6 Oct 2011 at 12:29

GoogleCodeExporter commented 8 years ago
Thanks for reporting this.

Out of curiosity, why are you referencing the GoogleBase dll?

Original comment by ccherub...@google.com on 6 Oct 2011 at 12:37

GoogleCodeExporter commented 8 years ago
It's a leftover from when I was testing it, it is not necessary and can be 
removed

Original comment by j...@potentiality.com.au on 6 Oct 2011 at 1:06

GoogleCodeExporter commented 8 years ago
Request from 
http://code.google.com/apis/analytics/docs/gdata/gdataExplorer.html looks 
(https://www.google.com/analytics/feeds/data?ids=ga%3A5814208&dimensions=ga%3Amo
nth%2Cga%3ApagePath&metrics=ga%3Apageviews&filters=ga%3ApagePath%3D%40%2Fuk%2Fkc
s%2Focd.aspx%3Bga%3ApagePath%3D%40%23h_&start-date=2011-07-01&end-date=2011-10-0
6&max-results=50)
identical to DataQuery.CalculateQuery except # is not URL encoded 
(       https://www.google.com/analytics/feeds/data?max-results=200&dimensions=ga%3Am
onth%2Cga%3ApagePath&end-date=2011-09-06&filters=ga%3ApagePath%3D%40%2Fuk%2Fkcs%
2Focd.aspx%3Bga%3ApagePath%3D%40#h_&ids=ga%3A5814208&metrics=ga%3Apageviews&star
t-date=2011-06-01)

Original comment by j...@potentiality.com.au on 6 Oct 2011 at 1:48

GoogleCodeExporter commented 8 years ago
I just performed some tests and it looks like the .NET library correctly 
encodes the # symbol as %23. The Data Feed Query Explorer also does the same.

Are you using the latest version of the library?
If you still get the exception when using the # symbol in your filter, please 
capture the HTTP traffic with Fiddler and share it here so that inspect it.
Thanks

Original comment by ccherub...@google.com on 21 Oct 2011 at 12:25