I'm not sure how you want to send the data to a web server. But you
can e.g. store the png as a string like this:
In [1]: import pygraphviz
In [2]: A=pygraphviz.AGraph()
In [3]: A.add_edge(1,2)
In [4]: A.layout()
In [5]: png=A.draw(format='png')
In [6]: png
Out[6]: '\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xb4\x00\x00\x00L\x02\x03\x00\x00\x00\xb9bu\xd5\x00\x00\x00\x0cPLTE\xfe\xff\xff\xd3\xd3\xd3\x00\x00\x00\xff\xff\xff\\\xa4}\xeb\x00\x00\x00\x01tRNS\x00@\xe6\xd8f\x00\x00\x01\x92IDATH\x89\xed\x96K\xb6\x83
\x0c\x86\xd9\xffRt\xc0\x12\xd8\x0f\x0e\x98\xe39\xf4V+!\xe4\xf1k\xc7\xbd\x19\xf4H\xfa\x19B\xcc\x83\xf0\xfaF\
etc
Aric