samjee / google-api-objectivec-client

Automatically exported from code.google.com/p/google-api-objectivec-client
0 stars 0 forks source link

GTLService always sends POST request #61

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Going through the GTLService.m file I discovered that the library always uses 
POST as HTTP method. Isn't that wrong? I'm requesting a list from the YouTube 
API and the HTTP method for that should be GET, however the library always uses 
POST.

In -GTLService 
fetchObjectWithMethodNamed:objectClass:parameters:bodyObject:requestID:urlQueryP
arameters:delegate:didFinishSelector:completionHandler:executingQuery:ticket: 
and in executeBatchQuery:delegate:didFinishSelector:completionHandler:ticket: 
the method is hardcoded to POST as you can see in the attached screenshot. Only 
the REST fetch method 
fetchObjectWithURL:objectClass:bodyObject:ETag:httpMethod:mayAuthorize:delegate:
didFinishSelector:completionHandler:ticket: has a flexible HTTP method but that 
is never used in any of my API calls.

Original issue reported on code.google.com by jonas.m....@gmail.com on 24 Apr 2014 at 11:22

Attachments:

GoogleCodeExporter commented 9 years ago
The library uses json rpc for the queries it generates, so that always is a 
POST.  There are methods exposed on the service to allow someone to make their 
own REST calls, the library just doesn't generate those.

Original comment by thomasvl@google.com on 24 Apr 2014 at 12:05