RTF
RTF

Reputation: 6494

Establishing connection between client and Google App Engine server

I have a need for my client(s) to send data to my app engine application that should go something like this:

  1. Client --> Server (This is the data that I have)
  2. Server --> Client (Based on what you've just given me, this is what I'm going to need)
  3. Client --> Server (Here's the data that you need)

I don't have much experience working with REST interfaces, but it seems that GET and POST are not entirely appropriate here. I'm assuming that the client needs to establish some kind of persistent connection with the server so they can both have a proper "conversation". My understanding is that sockets are reserved for paid apps, and I'd like to keep this on the free tier. However, I'm not sure of how to go about this. Is it the Channel API I should be using? I'm a bit confused by the documentation.

The app engine app is Python, as is the client. The solution that I'm leaning towards right now is that the client does a POST to the server (here's what I have), and subsequently does a GET (tell me what you need) and lastly does a POST (here's the data you wanted). But it seems messy.

Can anyone point me in the right direction please?

EDIT:
I didn't realize that you could get the POST response with Pythons urllib using the 'read' function of the object returned by urlopen. That makes things a lot nicer, but if anyone has any other suggestions I'd be glad to hear them.

Upvotes: 0

Views: 105

Answers (1)

Zig Mandel
Zig Mandel

Reputation: 19835

What you suggest is the right way. 1&2 is a single post. Then you post again to the server.

Upvotes: 3

Related Questions