It’s just data

Debugging AtomAPI implementations

Quick start:

Now that you are up and running, some more information on what you should be seeing.

When debugging HTTP applications, it is helpful to be able to see all the traffic that goes back and forth. To assist with the development of Apache Axis, tcpmon was created.  Among other things it can act as a proxy, and in the process it will capture, timestamp, and display all requests and responses.

Python's urllib is protocol independent, and has proxy support.  Unfortunately, it's HTTP support is limited, requiring wxAtomClient to frequently drop down to the lower level httplib.  Fortunately, adding proxy support for HTTP is fairly easy:

def getConnection(server, port, verb, url, xml, headers):
   import os
   if os.environ.has_key('http_proxy'):
     url=urlparse.urljoin(('http://%s:%d' % (server,port)),url)
     proxy=urlparse.urlparse(os.environ['http_proxy'])[1].split(':')
     server=proxy[0]
     port=(len(proxy)>1) and int(proxy[1]) or 80
   conn = httplib.HTTPConnection(server,port)
   conn.request(verb, url, xml, headers)
   return conn

Independent of the monitoring usages, proxy support is a valuable thing to have in an HTTP client.

Fun things to explore: the Save and Resend button.  You can even edit the request before resending.  The Content-Length header will automatically be adjusted.


Thanks Sam! I will roll this into the next release of the client code.

Posted by joe at

Testing AtomAPI implementations

Sam Ruby has a quick-start guide for monitoring AtomAPI data transfer (or debugging anything else that uses http) with the tcpmon tool from Apache Axis. He also has a patch for Mark and Joe's API client which gives it proxy......

Excerpt from Formerly Echo at

Cool tool!* Any more like this up your sleeve?

(* Though I won't be ditching telnet and ugly servlet hacks just yet ;-)

Posted by Danny at

In addition for any users running Mozilla don't forget the Web Development Tool option of Live HTTP Headers. I often surf with this option turned on.

Posted by Carl Garland at

This probably isn't the right place for this rant, but the need to set up an OS environment variable with your HTTP Proxy address for the urllib class is just plain brain-dead. It should be a property of the class, or at very least a global variable in the HTTP module. I spent ages trying to figure out how to get urllib to work over a proxy, and came out of the experience baffled at the way it is meant to work. As far as I know there isn't a single other Python module that relies on some environment variable and I don't see why urllib is different.

Posted by Simon Willison at

AtomAPI debugging tips (applies to any HTTP app)

(SOURCE:Sam Ruby: Debugging AtomAPI implementations)- Cool, thanks Sam! QUOTEQuick start: * Download tcpmon.jar * java -jar tcpmon.jar 8003 * Download and unzip wxAtomClient_25Aug2003.zip * Replace atomClientAPI.py * SET...

Excerpt from Roland Tanglao's Weblog at

AtomDigest via urllib2

Mark and Joe's prototype  AtomAPI implementation in Python uses the low level  httplib classes.  This means that things like proxy support needs to be explicitly added. An alternative is to use the higher level  urllib2 classes... [more]

Trackback from Sam Ruby

at

Redirected request in HttpWebRequest does not maintain specified method!

This appears to be a critical bug in the .NET Framework. Surely I am wrongthough! PLEASE HELP if anyone has any idea?Thanks,Jon________________________________From: Jon Davis [mailto:jon@accentra.net]Sent: Friday, March 26, 2004 9:31 PMTo:...

Excerpt from DotNet - - dotnet.itags.org at

Add your comment