Search code examples
ajaxjsongoogle-app-engineknockout.jsprotorpc

Is ProtoRPC API the GAE built-in for ajax?


Next step: an ajax frontend for a gae/py app.

My app have only basic html version that interacts with the datastore and updates the page everytime. It's ok but now it needs ajax. I tried some solution: basic javascript, jquery's ajax API and some frameworks.

I think I found everything I was looking for in knockoutjs but this framework interacts with the server throught the json format. This means that i need learn the json library and rewrite all handlers so get and post in json. I can start this task but before I want understood something more about ProtoRPC API.

The docs says that this API is useful also for "Creating structured Ajax backends" and if I understood fine the messages in response is in json format. My questions is:

It's true that ProtoRPC API messages use json?

It will be a problem that all the request/response pass throught ProtoRPC?

Implement a server-side solid ProtoRPC service and use the framework for client-side is a good strategy?


Solution

  • ProtoRPC comes with a JSON implementation of its transmission protocol.

    You should be able to build your server side logic using ProtoRPC, and issue HTTP request to your API endpoints with messages encoded in JSON, as described on the ProtoRPC overview in the official documentation.

    Knockoutjs shouldn't get in the way, since the documentation state that it doesn’t force you to use any one particular technique to load or save data