views:

705

answers:

1

Sorry for being the 100000th person to ask the same question. But I guess my case is slightly distinctive.

The application is that we'd like to have an Android phone client on 3g and a light python web service server.

The phone would do most of the work and do a lot of uploading, pictures, GPS, etc etc. The server just has to respond with an 'ok' per upload.

I want to use the lightest method, easiest on the battery. But reading about all these protocols is a bit confusing since they all sound the same.

Are they all on the same levels? Or can JSON be a RESTful thing etc? So as described, the key here is uploading. Does all the input for a REST transaction have to be in a URI? ie http://www.server.com/upload/0x81d058f82ac13............................... XML-RPC and SOAP sound decently similar from Googling too.

Thanks for any advice

+5  A: 

REST mandates the general semantics and concepts. The transport and encodings are up to you. They were originally formulated on XML, but JSON is totally applicable.

XML-RPC / SOAP are different mechanisms, but mostly the same ideas: how to map OO APIs on top of XML and HTTP. IMHO, they're disgusting from a design view. I was so relieved when found about REST. In your case, i'm sure that the lots of layers would mean a lot more CPU demand.

I'd say go REST, using JSON for encoding; but if your requirements are really that simple as just uploading, then you can use simply HTTP (which might be RESTful in design even without adding any specific library)

Javier
Plain old HTTP should work. The HTTP response code header can be used to indicate success or failure. Somthing in the 2xx range for success, and 4xx for failure. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
MadCoder
REST is plain old HTTP. It's an approach to assigning semantics to the HTTP GET, POST and URI paths.
S.Lott
I don't get how is REST more simple than XML-RPC however.If I get it right, a JSON post would be something likehttp://server.com/class1HTTP POST{"blah blah:", "json stuff"}and an XML-RPC post would behttp://server.comHTTP POST<method><name>class1</name><xml stuff>stuff</xml stuff></method>So besides the fact that XML is a bit fatter than JSON, is there anything else fundamentally different between them?
Xster
@Xster: XML-RPC is an RPC, that is, you design an API and publish all the objects, and the methods specific to each one and all the relationships between them. with REST you design a representation that gives an URL to your resources. the verbs are only GET, POST, PUT and DELETE. The relationships are given by the URLs included in the appropriate fields of your representations.
Javier