Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Codewalkers:
Create Your Own Custom API
Feb 04, 2005 @ 13:17:25

Codewalkers.com has a new tutorial posted this morning - Create Your Own Custom API. If you've ever just gotten frustrated with XML-RPC, SOAP or any other "web service" protocol - do what Nathan did and write your own!

He starts off by explaining who would really benefit from developing their own API, as well as things to consider for the "other side" (you creating the software for them to use vs. creating documentation for them to roll their own). From there, he shows a sample layout for the interaction between the client and server. Moving on, he gives you the code to create the client software (with the predetermined XML request structure) using the cURL functionality compiled into PHP (you have it compiled in, right?). Of course, you can do the same kind of thing with a socket connection.

Once the client is in place, it's on to the server portion - the harder of the two. Obviously, creating the backend is going to be more difficult for the simple fact that it does all of the work. He wraps it all up with a class that interacts with the rest of the world, parsing the XML and performing the tasks it requests...

tagged:

Link:


Trending Topics: