Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 639639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:51:54+00:00 2026-05-13T20:51:54+00:00

I am coding a python (2.6) interface to a web service. I need to

  • 0

I am coding a python (2.6) interface to a web service. I need to communicate via http so that :

  • Cookies are handled automatically,
  • The requests are asynchronous,
  • The order in which the requests are sent is respected (the order in which the responses to these requests are received does not matter).

I have tried what could be easily derived from the build-in libraries, facing different problems :

  • Using httplib and urllib2, the requests are synchronous unless I use thread, in which case the order is not guaranteed to be respected,
  • Using asyncore, there was no library to automatically deal with cookies send by the web service.

After some googling, it seems that there are many examples of python scripts or libraries that match 2 out of the 3 criteria, but not the 3 of them. I am thinking of reading through the cookielib sources and adapting what I need of it to asyncore (or only to my application in a ad hoc manner), but it seems strange that nothing like this exists yet, as I guess I am not the only one interested. If anyone knows of pointers about this problem, it would be greatly appreciated.

Thank you.

Edit to clarify :

What I am doing is a local proxy that interfaces my IRC client with a webchat. It creates a socket that listens to IRC connections, then upon receiving one, it logs in the webchat via http. I don’t have access to the behaviour of the webchat, and it uses cookies for session IDs. When client sends several IRC requests to my python proxy, I have to forward them to the webchat’s server via http and with cookies. I also want to do this asynchronously (I don’t want to wait for the http response before I send the next request), and currently what happens is that the order in which the http requests are sent is not the order in which the IRC commands were received.

I hope this clarifies the question, and I will of course detail more if it doesn’t.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T20:51:55+00:00Added an answer on May 13, 2026 at 8:51 pm

    Using httplib and urllib2, the
    requests are synchronous unless I use
    thread, in which case the order is not
    guaranteed to be respected

    How would you know that the order has been respected unless you get your response back from the first connection before you send the response to the second connection? After all, you don’t care what order the responses come in, so it’s very possible that the responses come back in the order you expect but that your requests were processed in the wrong order!

    The only way you can guarantee the ordering is by waiting for confirmation that the first request has successfully arrived (eg. you start receiving the response for it) before beginning the second request. You can do this by not launching the second thread until you reach the response handling part of the first thread.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 541k
  • Answers 541k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer For starters, is there a reason you're using a very… May 17, 2026 at 2:49 am
  • Editorial Team
    Editorial Team added an answer You can read this book. There is a good example… May 17, 2026 at 2:49 am
  • Editorial Team
    Editorial Team added an answer I personally would not use Joomla, if I had to… May 17, 2026 at 2:49 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I've pretty much tried every Python web framework that exists, and it took me
I'm building a app that need manage money datatype. I'm new on Obj-c, so
As a summer learning experiment, I'm thinking of coding up a web front end
When coding python, I use the logging module a lot. After some bad experiences
I am giving Vim a serious try for coding my Python apps. However, Vim
Was coding something in Python. Have a piece of code, wanted to know if
I recently started learning Python. Not yet ventured into coding. During one of my
This is not a coding question, but am hoping that someone has come across
So I'm writing yet another Twisted based daemon. It'll have an xmlrpc interface as
My group is a Perl shop in an organization that is very heterogenous. Although

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.