XML(JSON?)-over-HTTP: How to define API?

Allen Fowler allen.fowler at yahoo.com
Thu Jul 2 18:17:56 EDT 2009

> I have an (in-development) python system that needs to shuttle events / requests 
> around over the network to other parts of itself.   It will also need to 
> cooperate with a .net application running on yet a different machine.
> So, naturally I figured some sort of HTTP event / RPC type of would be a good 
> idea?
> Are there any modules I should know about, or guidelines I could read, that 
> could aid me in the design of the API?    

To clarify:

Each message would be <1KB of data total, and consist of some structured object containing strings, numbers, dates, etc.

For instance there would be an "add user" request that would contain one or more User objects each having a number of properties like:

- Full Name
- Username
- Password
- Email addresses (a variable length array)
- Street Address line1
- Street Address line1
- Street Address line1
- City
- State
- Zip
- Sign Up Date

.... and so on.

Since I need to work with other platforms, pickle is out...  what are the alternatives?  XML? JSON?

How should I formally define each of the valid messages and objects?

Thank you,


More information about the Python-list mailing list