GoogleCloudPlatform / go-endpoints

Cloud Endpoints for Go
https://go-endpoints.appspot.com
Apache License 2.0
255 stars 56 forks source link

Post requests for discovery document? #143

Closed tdestro closed 8 years ago

tdestro commented 8 years ago

I've integrated Google APIs Client Library for Objective-C into my iPhone app. I have set up the Go Google App Engine SDK, and go-endpoints, generated a discovery document and built client libraries using the objc ServiceGenerator tool provided with the client library.

It seems the Objective C library always sends requests via POST while appengine and dev_appserver.py expects GET.

The broswer on the iphone spits out the discovery doc when i attempt to get it manually in safari (via GET).

The error in xcode: nil or Error Domain=com.google.HTTPStatus Code=404 "Not Found" UserInfo={NSLocalizedFailureReason=Not Found} Optional("GTLServiceTicket 0x15f5520f0: {service:<GTLServiceGreeting: 0x15f5150c0> fetcher:GTMSessionFetcher 0x15f54f020 (http://192.168.1.111:8080/_ah/api/discovery/v1/apis/greeting/v1/rpc?prettyPrint=false) }") Optional(Error Domain=com.google.HTTPStatus Code=404 "Not Found" UserInfo={NSLocalizedFailureReason=Not Found})

The corresponding error from dev_appserver.py console: INFO 2016-04-08 18:50:35,897 module.py:787] default: "POST /_ah/spi/BackendService.getApiConfigs HTTP/1.1" 200 1936 WARNING 2016-04-08 18:50:35,901 api_config_manager.py:264] No endpoint found for path: discovery/v1/apis/greeting/v1/rpc

Some probing around with wireshark revealed that the requests from the iphone are being sent via POST.

What am I doing wrong?