[MediaWiki-commits] [Gerrit] Make action=mobileview GET, not POST. - change (apps...wikipedia)
Dr0ptp4kt has uploaded a new change for review. https://gerrit.wikimedia.org/r/129823 Change subject: Make action=mobileview GET, not POST. .. Make action=mobileview GET, not POST. * Android uses GET for action=mobileview. So too shall iOS. * GET will make the traffic eligible for pageview counting. * Future work: if necessary, make parameter order and signatures consistent across platforms. * Future work: if necessary, make one of lead/remaining sections calls a POST to shield against double counting. * Note: the pageview calculation may be mutable to (not) count certain action=mobileview signatures. Change-Id: Ibf62c451f93eb00360f122ae1e1dcd8308f7d617 --- M wikipedia/Categories/NSURLRequest+DictionaryRequest.m M wikipedia/Data/Operations/DownloadLeadSectionOp.m M wikipedia/Data/Operations/DownloadNonLeadSectionsOp.m 3 files changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/23/129823/1 diff --git a/wikipedia/Categories/NSURLRequest+DictionaryRequest.m b/wikipedia/Categories/NSURLRequest+DictionaryRequest.m index ccde940..ae17b7e 100644 --- a/wikipedia/Categories/NSURLRequest+DictionaryRequest.m +++ b/wikipedia/Categories/NSURLRequest+DictionaryRequest.m @@ -43,6 +43,7 @@ [request setHTTPMethod:@"GET"]; [request addValue:@"" forHTTPHeaderField:@"Accept-Encoding"]; [request addValue:[WikipediaAppUtils versionedUserAgent] forHTTPHeaderField:@"User-Agent"]; +// NSLog(@"%@", [WikipediaAppUtils versionedUserAgent]); [request addValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"]; return request; } diff --git a/wikipedia/Data/Operations/DownloadLeadSectionOp.m b/wikipedia/Data/Operations/DownloadLeadSectionOp.m index feadd29..0ab9c85 100644 --- a/wikipedia/Data/Operations/DownloadLeadSectionOp.m +++ b/wikipedia/Data/Operations/DownloadLeadSectionOp.m @@ -18,7 +18,7 @@ { self = [super init]; if (self) { -self.request = [NSURLRequest postRequestWithURL: [[SessionSingleton sharedInstance] urlForDomain:domain] +self.request = [NSURLRequest getRequestWithURL: [[SessionSingleton sharedInstance] urlForDomain:domain] parameters: @{ @"action": @"mobileview", @"prop": @"sections|text|lastmodified|lastmodifiedby|languagecount", diff --git a/wikipedia/Data/Operations/DownloadNonLeadSectionsOp.m b/wikipedia/Data/Operations/DownloadNonLeadSectionsOp.m index 86c3703..73f08d5 100644 --- a/wikipedia/Data/Operations/DownloadNonLeadSectionsOp.m +++ b/wikipedia/Data/Operations/DownloadNonLeadSectionsOp.m @@ -16,7 +16,7 @@ { self = [super init]; if (self) { -self.request = [NSURLRequest postRequestWithURL: [[SessionSingleton sharedInstance] urlForDomain:domain] +self.request = [NSURLRequest getRequestWithURL: [[SessionSingleton sharedInstance] urlForDomain:domain] parameters: @{ @"action": @"mobileview", @"prop": @"sections|text", -- To view, visit https://gerrit.wikimedia.org/r/129823 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf62c451f93eb00360f122ae1e1dcd8308f7d617 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Dr0ptp4kt ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Make action=mobileview GET, not POST. - change (apps...wikipedia)
Brion VIBBER has submitted this change and it was merged. Change subject: Make action=mobileview GET, not POST. .. Make action=mobileview GET, not POST. * Android uses GET for action=mobileview. So too shall iOS. * GET will make the traffic eligible for pageview counting. * Future work: if necessary, make parameter order and signatures consistent across platforms. * Future work: if necessary, make one of lead/remaining sections calls a POST to shield against double counting. * Note: the pageview calculation may be mutable to (not) count certain action=mobileview signatures. Change-Id: Ibf62c451f93eb00360f122ae1e1dcd8308f7d617 --- M wikipedia/Categories/NSURLRequest+DictionaryRequest.m M wikipedia/Data/Operations/DownloadLeadSectionOp.m M wikipedia/Data/Operations/DownloadNonLeadSectionsOp.m 3 files changed, 3 insertions(+), 2 deletions(-) Approvals: Brion VIBBER: Verified; Looks good to me, approved diff --git a/wikipedia/Categories/NSURLRequest+DictionaryRequest.m b/wikipedia/Categories/NSURLRequest+DictionaryRequest.m index ccde940..ae17b7e 100644 --- a/wikipedia/Categories/NSURLRequest+DictionaryRequest.m +++ b/wikipedia/Categories/NSURLRequest+DictionaryRequest.m @@ -43,6 +43,7 @@ [request setHTTPMethod:@"GET"]; [request addValue:@"" forHTTPHeaderField:@"Accept-Encoding"]; [request addValue:[WikipediaAppUtils versionedUserAgent] forHTTPHeaderField:@"User-Agent"]; +// NSLog(@"%@", [WikipediaAppUtils versionedUserAgent]); [request addValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"]; return request; } diff --git a/wikipedia/Data/Operations/DownloadLeadSectionOp.m b/wikipedia/Data/Operations/DownloadLeadSectionOp.m index feadd29..0ab9c85 100644 --- a/wikipedia/Data/Operations/DownloadLeadSectionOp.m +++ b/wikipedia/Data/Operations/DownloadLeadSectionOp.m @@ -18,7 +18,7 @@ { self = [super init]; if (self) { -self.request = [NSURLRequest postRequestWithURL: [[SessionSingleton sharedInstance] urlForDomain:domain] +self.request = [NSURLRequest getRequestWithURL: [[SessionSingleton sharedInstance] urlForDomain:domain] parameters: @{ @"action": @"mobileview", @"prop": @"sections|text|lastmodified|lastmodifiedby|languagecount", diff --git a/wikipedia/Data/Operations/DownloadNonLeadSectionsOp.m b/wikipedia/Data/Operations/DownloadNonLeadSectionsOp.m index 86c3703..73f08d5 100644 --- a/wikipedia/Data/Operations/DownloadNonLeadSectionsOp.m +++ b/wikipedia/Data/Operations/DownloadNonLeadSectionsOp.m @@ -16,7 +16,7 @@ { self = [super init]; if (self) { -self.request = [NSURLRequest postRequestWithURL: [[SessionSingleton sharedInstance] urlForDomain:domain] +self.request = [NSURLRequest getRequestWithURL: [[SessionSingleton sharedInstance] urlForDomain:domain] parameters: @{ @"action": @"mobileview", @"prop": @"sections|text", -- To view, visit https://gerrit.wikimedia.org/r/129823 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibf62c451f93eb00360f122ae1e1dcd8308f7d617 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Dr0ptp4kt Gerrit-Reviewer: Brion VIBBER Gerrit-Reviewer: Dbrant Gerrit-Reviewer: Mhurd Gerrit-Reviewer: Yuvipanda ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits