newb: Twisted and API for Web Services
Question1: How do I distinguish the request in Twisted web for each uri and call the appropriate class to handle the request, and response back a xml data? Question2: It will be listening on port 8080. How does this get translated to url? For example, my URI as follows: http://api.example.org/auto/Ford http://api.example.org/auto/Chevy http://api.example.org/auto/add http://api.example.org/auto/delete http://api.example.org/dealer/inventory http://api.example.org/dealer/invoice Thank you, it would be nice if you guys moved your mailing list to google groups. Just my 2 cents.
On Thu, 22 Mar 2007 15:45:25 -0500, Ram Peters <rampeters@gmail.com> wrote:
Question1: How do I distinguish the request in Twisted web for each uri and call the appropriate class to handle the request, and response back a xml data?
See http://twistedmatrix.com/projects/web/documentation/howto/using-twistedweb.h... At the url mentioned above, pay attention to the parts about getChild and putChild. If you are using twisted.web2, then see http://twistedmatrix.com/projects/web2/documentation/howto/object-traversal....
Question2: It will be listening on port 8080. How does this get translated to url?
For example, my URI as follows: http://api.example.org/auto/Ford http://api.example.org/auto/Chevy http://api.example.org/auto/add http://api.example.org/auto/delete http://api.example.org/dealer/inventory http://api.example.org/dealer/invoice
If your server is listening on port 8080, your URLs will look like this: http://api.example.org:8080/auto/Ford http://api.example.org:8080/auto/Chevy http://api.example.org:8080/auto/add http://api.example.org:8080/auto/delete http://api.example.org:8080/dealer/inventory http://api.example.org:8080/dealer/invoice Hope this helps, L. Daniel Burr
On 3/22/07, Ram Peters <rampeters@gmail.com> wrote:
Question1: How do I distinguish the request in Twisted web for each uri and call the appropriate class to handle the request, and response back a xml data?
Question2: It will be listening on port 8080. How does this get translated to url?
For example, my URI as follows: http://api.example.org/auto/Ford http://api.example.org/auto/Chevy http://api.example.org/auto/add http://api.example.org/auto/delete http://api.example.org/dealer/inventory http://api.example.org/dealer/invoice
Thank you
Also, be sure you are using the right tool for the right job for the right reasons :-) Read this page for more direction/information: http://twistedmatrix.com/trac/wiki/WebDevelopmentWithTwisted
participants (3)
-
Duncan McGreggor
-
L. Daniel Burr
-
Ram Peters