Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #29146

Re: Batching HTTP requests with httplib (Python 2.7)

Path csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail
From Chicken McNuggets <chicken@mcnuggets.com>
Newsgroups comp.lang.python
Subject Re: Batching HTTP requests with httplib (Python 2.7)
Date Fri, 14 Sep 2012 10:53:51 +0100
Organization Aioe.org NNTP Server
Lines 38
Message-ID <k2uurd$re8$1@speranza.aioe.org> (permalink)
References <k2t90g$4e4$1@speranza.aioe.org> <mailman.659.1347589892.27098.python-list@python.org>
NNTP-Posting-Host zo3N1Qawas9wd1mRiy/+Xg.user.speranza.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0
X-Notice Filtered by postfilter v. 0.8.2
Xref csiph.com comp.lang.python:29146

Show key headers only | View raw


On 14/09/2012 03:31, Cameron Simpson wrote:
> On 13Sep2012 19:34, Chicken McNuggets <chicken@mcnuggets.com> wrote:
> | I'm writing a simple library that communicates with a web service and am
> | wondering if there are any generally well regarded methods for batching
> | HTTP requests?
> |
> | The problem with most web services is that they require a list of
> | sequential commands to be executed in a certain order to complete a
> | given task (or at least the one I am using does) so having to manually
> | call each command is a bit of a pain. How would you go about the design
> | of a library to interact with these services?
> |
> | Any help is greatly appreciated :).
>
> Maybe I'm missing something. What's hard about:
>
>    - wrapping the web services calls in a simple wrapper which
>      composes the call, runs it, and returns the result parts
>      This lets you hide all the waffle about the base URL,
>      credentials etc in the wrapper and only supply the essentials
>      at call time.
>
>    - writing your workflow thing then as a simple function:
>
>        def doit(...):
>          web_service_call1(...)
>          web_service_call2(...)
>          web_service_call3(...)
>
>      with whatever internal control is required?
>
> This has worked for me for simple things.
>
> What am I missing about the larger context?
>

That is what I have at the moment but it is ugly as hell. I was 
wondering if there was a somewhat more elegant solution that I was missing.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Batching HTTP requests with httplib (Python 2.7) Chicken McNuggets <chicken@mcnuggets.com> - 2012-09-13 19:34 +0100
  Re: Batching HTTP requests with httplib (Python 2.7) Cameron Simpson <cs@zip.com.au> - 2012-09-14 12:31 +1000
    Re: Batching HTTP requests with httplib (Python 2.7) Chicken McNuggets <chicken@mcnuggets.com> - 2012-09-14 10:53 +0100
      Re: Batching HTTP requests with httplib (Python 2.7) Dwight Hutto <dwightdhutto@gmail.com> - 2012-09-14 06:56 -0400
      Re: Batching HTTP requests with httplib (Python 2.7) Cameron Simpson <cs@zip.com.au> - 2012-09-15 19:30 +1000
      Re: Batching HTTP requests with httplib (Python 2.7) Xavier Combelle <xavier.combelle@free.fr> - 2012-09-14 13:46 +0200
        Re: Batching HTTP requests with httplib (Python 2.7) Neil Cerutti <neilc@norwich.edu> - 2012-09-18 12:40 +0000

csiph-web