Login | Register
My pages Projects Community openCollabNet

Discussions > dev > Re: [maxq-dev] IAgent - pluggable HTTP agents

maxq
Discussion topic

Back to topic list

Re: [maxq-dev] IAgent - pluggable HTTP agents

Author oliverbock
Full name Oliver Bock
Date 2004-10-18 15:19:16 PDT
Message On 19/10/2004, at 04:02, hdara at primavera dot com wrote:
> Good idea. In addition to Frank's comments,
>
> - Why is getResponseText returning int? I presume it is simply a
> mistake,
> but I would make it return a byte array.

I did initially think it should be a String because this makes things
simpler and because the cost of unnecessarily converting to a String is
small enough to be irrelevant in comparison to the time we must wait
for network connections. However there may also be an issue with
non-single-byte character sets and the chance that the response is a
binary file so I think you are right. byte[] it is. I have renamed
the function to getResponseBytes() and think that the Jython base class
will provide a response() function that converts it to a PyString.
(For a moment there I was tempted to call it getResponseText(). I
think I am being infected by the unpleasant preference Java programmers
have for long names. I think this would be a mistake in Python
interfaces; Python thrives on concision.)

> - How about allowing these methods to throw some exceptions, such as
> IOException, or network related ones? You could also think about
> create a
> wrapper exception as part of the interface.

Another good point. get() and post() now throw Exception. If
implementors want to convert their native exceptions into something
more readable then they should use Utils.UserException.

> - get() and post() accepting Object type array is a bit obscure. How
> would
> one pass name and value pairs? Also, can you pass null if you don't
> have
> any parameters? Could you clarify on this?

It now reads:

  params Must contain an array of PyTuples. Each PyTuple contains a
parameter name and a parameter value. Null will be interpreted as an
empty list of parameters.

My intention is that this data structure can be written in Jython using
this compact syntax:

[('name', 'value'), ('name2', 'value2')...]

> - How about having setters for configuring proxy information too (Frank
> just asked for getters).

Proxy configuration is available reading in maxq.Config. This is
simpler than requiring whoever constructs the agent to call a set
function.


    Oliver


--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: dev-unsubscribe at maxq dot tigris dot org
For additional commands, e-mail: dev-help at maxq dot tigris dot org

« Previous message in topic | 12 of 12 | Next message in topic »

Messages

Show all messages in topic

[maxq-dev] IAgent - pluggable HTTP agents oliverbock Oliver Bock 2004-10-18 01:14:06 PDT
     Re: [maxq-dev] IAgent - pluggable HTTP agents fcohen Frank Cohen 2004-10-18 09:41:39 PDT
         Re: [maxq-dev] IAgent - pluggable HTTP agents oliverbock Oliver Bock 2004-10-18 15:00:14 PDT
             Re: [maxq-dev] IAgent - pluggable HTTP agents fcohen Frank Cohen 2004-10-18 16:19:00 PDT
                 Re: [maxq-dev] IAgent - pluggable HTTP agents oliverbock Oliver Bock 2004-10-18 16:33:03 PDT
                     Re: [maxq-dev] IAgent - pluggable HTTP agents fcohen Frank Cohen 2004-10-18 16:40:42 PDT
                         Re: [maxq-dev] IAgent - pluggable HTTP agents oliverbock Oliver Bock 2004-10-18 16:46:26 PDT
                             Re: [maxq-dev] IAgent - pluggable HTTP agents fcohen Frank Cohen 2004-10-18 18:29:00 PDT
                                 Re: [maxq-dev] IAgent - pluggable HTTP agents oliverbock Oliver Bock 2004-10-18 18:47:04 PDT
                                     Re: [maxq-dev] IAgent - pluggable HTTP agents fcohen Frank Cohen 2004-10-18 19:19:08 PDT
     Re: [maxq-dev] IAgent - pluggable HTTP agents hdara at primavera dot com hdara at primavera dot com 2004-10-18 11:02:51 PDT
         Re: [maxq-dev] IAgent - pluggable HTTP agents oliverbock Oliver Bock 2004-10-18 15:19:16 PDT
Messages per page: