471,325 Members | 1,484 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,325 software developers and data experts.

Persistent HTTP Connections with Python?

Hello All,

I am trying to write a python script to talk to an xml-based stock feed
service. They are telling me that I must connect and login, and then
"issue refresh requests" to fetch the data. This sounds a lot (to me)
like HTTP 1.1 persistent connections. Can I do that with the urllib
functions, or do I need to use the httplib functions for this kind of
work. Pointers and/or sample code would be much appreciated.

Thanks!

-scott
Jan 10 '08 #1
2 3880
On Jan 10, 10:46 am, Scott Sharkey <sshar...@linuxunlimited.com>
wrote:
Hello All,

I am trying to write a python script to talk to an xml-based stock feed
service. They are telling me that I must connect and login, and then
"issue refresh requests" to fetch the data. This sounds a lot (to me)
like HTTP 1.1 persistent connections. Can I do that with the urllib
functions, or do I need to use the httplib functions for this kind of
work. Pointers and/or sample code would be much appreciated.
Your questions leaves out all important details like the exact nature
of the API being provided. I highly doubt HTTP persistent connections
has anything to do with what you will need to connect to there
service.

Services like this normally come with example code, i recommend you
get access to that.

Regards,
Ivan Novick
http://www.0x4849.net
Jan 11 '08 #2
On Jan 10, 12:46*pm, Scott Sharkey <sshar...@linuxunlimited.com>
wrote:
Hello All,

I am trying to write a python script to talk to an xml-based stock feed
service. *They are telling me that I must connect and login, and then
"issue refresh requests" to fetch the data. *This sounds a lot (to me)
like HTTP 1.1persistentconnections. *Can I do that with the urllib
functions, or do I need to use the httplib functions for this kind of
work. *Pointers and/or sample code would be much appreciated.

Thanks!

-scott
I used to work in the financial industry and I have seen this.
It is sort of like the XML RSS feed that web sites provide -- but like
many financial protocols they created their own standard.
Python httplib can be used to create a SERVER for persistent HTTP
connections -- but want you want is a client.
I think this is actually very simple.
What happens when you open the data URL with a web browser ?
Does the connection stay open and automatically update each time there
is new data ?
If so, just use urllib, leave the connection open and do a read()
every so often to see if there is new data.
Good luck!
-Rob

Jan 12 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Randell D. | last post: by
2 posts views Thread by Steve Jenkins | last post: by
3 posts views Thread by Derek Fountain | last post: by
5 posts views Thread by Felix E. Klee | last post: by
16 posts views Thread by Paul Rubin | last post: by
1 post views Thread by Chris Spencer | last post: by
2 posts views Thread by Jim Hubbard | last post: by
6 posts views Thread by David Rasmussen | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.