GTLServiceBlogger *service = [[GTLServiceBlogger alloc] init];
service.APIKey = MY_API_KEY;
GTLQueryBlogger *query = [GTLQueryBlogger queryForPostsSearchWithBlogId:BLOG_ID];
query.q = searchQuery;
query.pageToken = pageIdentifier;
[service executeQuery:query
completionHandler:^(GTLServiceTicket *ticket,
GTLBloggerPostList *postList, NSError *error) {
if(error == nil)
{
//Do something with result
}
else{
//Display error
}
}];
Thanks in advance.
[service executeQuery:query
completionHandler:^(GTLServiceTicket *ticket,
GTLBloggerPostList *searchResult, NSError *error) {
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
if(error == nil)
{
pageIdentifier = searchResult.nextPageToken;
for(GTLBloggerPost *post in searchResult)
{
//Do something with posts
}
}
else{
//Error handling
}
}];
As for HTTP logging:
This is the first request I make (without a page token):
2012-11-17 21:19:01 +0000
Request: POST https://www.googleapis.com/rpc?prettyPrint=false
Request headers:
Accept: application/json-rpc
Cache-Control: no-cache
Content-Type: application/json-rpc; charset=utf-8
User-Agent: <OMITTED>
Request body: (181 bytes)
{
"id" : "gtl_3",
"apiVersion" : "v3",
"params" : {
"q" : <OMITTED>,
"key" : <OMITTED>,
"blogId" : <OMITTED>
},
"method" : "blogger.posts.search",
"jsonrpc" : "2.0"
}
Response: status 200
Response headers:
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 39784
Content-Type: application/json; charset=UTF-8
Date: Sat, 17 Nov 2012 21:19:01 GMT
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Pragma: no-cache
Server: GSE
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block
Response body: (202394 bytes)
{
"id" : "gtl_3",
"result" : {
"kind" : "blogger#postList",
"nextPageToken" : "CgkIChiB04DgrycQqq6Mr9WqpPIZ",
"items" : [
<POSTS OMITTED>
]
}
}
And this is the request http log from the second call and onward with the page identifier added:
2012-11-17 21:19:27 +0000
Request: POST https://www.googleapis.com/rpc?prettyPrint=false
Request headers:
Accept: application/json-rpc
Cache-Control: no-cache
Content-Type: application/json-rpc; charset=utf-8
User-Agent: <OMITTED>
Request body: (224 bytes)
{
"id" : "gtl_7",
"apiVersion" : "v3",
"params" : {
"pageToken" : "CgkIChiB04DgrycQqq6Mr9WqpPIZ",
"q" : "<OMITTED>,
"key" : <OMITTED>,
"blogId" : <OMITTED>
},
"method" : "blogger.posts.search",
"jsonrpc" : "2.0"
}
Response: status 200
Response headers:
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 39784
Content-Type: application/json; charset=UTF-8
Date: Sat, 17 Nov 2012 21:19:27 GMT
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Pragma: no-cache
Server: GSE
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block
Response body: (202394 bytes)
{
"id" : "gtl_7",
"result" : {
"kind" : "blogger#postList",
"nextPageToken" : "CgkIChiB04DgrycQqq6Mr9WqpPIZ",
"items" : [
<POSTS OMITTED (Same items as last request)>
]
}
}
-----------------------------------------------------------