--
You received this message because you are subscribed to the Google Groups "Paste Users" group.
To post to this group, send email to paste...@googlegroups.com.
To unsubscribe from this group, send email to paste-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/paste-users?hl=en.
Thomas G. Willis
To unsubscribe from this group, send email to paste-users+unsubscribe@googlegroups.com.
Yeah my next step was to experiment with friendlier syntax and see how far I got. Though maybe I'm just used to it, but the syntax doesn't seem all that bad as is. I guess a good "pain test" would be "would I type this in the console?" .
So, then I started looking at the cookie jar logic and at first I thought that could be in middleware(and I would borrow webtests cookie handling), but now I'm not so sure. It seems more appropriate to be a part of the proxy or whatever piece gets to call urllib.
I haven't quite thought it through yet but a jumble of components(not calling it a framework) seems to be emerging in theory that could be composed into a nice client http library but also with all the pieces available for you to assemble your own for whatever needs you may have, and with established patterns on how/what to extend when/why.I have a lot of potential uses for this kind of thing myself.About the ProxyApp, what is the difference if any between proxy_exact_request and paste.proxy.TransparentProxy ?
On Mon, Apr 9, 2012 at 2:06 PM, Thomas G. Willis <tom.w...@gmail.com> wrote:Yeah my next step was to experiment with friendlier syntax and see how far I got. Though maybe I'm just used to it, but the syntax doesn't seem all that bad as is. I guess a good "pain test" would be "would I type this in the console?" .
Well, simply copying the Requests API verbatim seemed like a reasonable starting point. There are some minor differences that might or might not be worth papering over. status_int is actually kind of a terrible name, changing/adding "status_code" as a name in webob seems reasonable to me.
Auth is funny, because it often has to operate on the request itself, as many auth techniques sign the request.
So, then I started looking at the cookie jar logic and at first I thought that could be in middleware(and I would borrow webtests cookie handling), but now I'm not so sure. It seems more appropriate to be a part of the proxy or whatever piece gets to call urllib.
I think the proxy should be relatively opaque – it might have settings, but I think holding the cookie jar would be wrong. It would make it hard to tell what cookies you actually sent. I think the instantiated request object should be as accurate as possible.
I haven't quite thought it through yet but a jumble of components(not calling it a framework) seems to be emerging in theory that could be composed into a nice client http library but also with all the pieces available for you to assemble your own for whatever needs you may have, and with established patterns on how/what to extend when/why.I have a lot of potential uses for this kind of thing myself.About the ProxyApp, what is the difference if any between proxy_exact_request and paste.proxy.TransparentProxy ?
Not much; I believe proxy_exact_request gets rid of the tiny bit of statefulness that TransparentProxy has, by using SERVER_NAME/SERVER_PORT instead of the force* settings with TransparentProxy.
On Monday, April 9, 2012 4:24:13 PM UTC-4, Ian Bicking wrote:On Mon, Apr 9, 2012 at 2:06 PM, Thomas G. Willis <tom.w...@gmail.com> wrote:
... But I guess I was trying to figure out how to fit into existing api's. Doesn't the cookielib.CookieJar expect a urllib request?
Is there an identical API that doesn't depend on that?
+0.5 from me =)
-Sergey
> --
> You received this message because you are subscribed to the Google Groups
> "Paste Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/paste-users/-/YAiCq9dzYvMJ.
>
> To post to this group, send email to paste...@googlegroups.com.
> To unsubscribe from this group, send email to
> paste-users...@googlegroups.com.
+1 on client. And maybe rename proxy_exact_request to send_request_app.
On Thu, Apr 12, 2012 at 5:20 PM, Sergey Schetinin <mal...@gmail.com> wrote:
I think calling it "proxy" could be a little confusing, maybe webob.client?
On 12 April 2012 20:02, Thomas G. Willis <tom.w...@gmail.com> wrote:
> Are you thinking something like webob.proxy.proxy_exact_request ? or
> something?
>
>
>
> On Wednesday, April 11, 2012 5:31:30 PM UTC-4, Sergey Schetinin wrote:
>>
>> I don't expect to be using this myself, so I don't think I have
>> anything to add to the discussion, but this seems useful and I have no
>> objections to merging the necessary parts into webob.
>>
>> +0.5 from me =)
>>
>> -Sergey
>
> --
> You received this message because you are subscribed to the Google Groups
> "Paste Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/paste-users/-/YAiCq9dzYvMJ.
>
> To post to this group, send email to paste...@googlegroups.com.
> To unsubscribe from this group, send email to
> For more options, visit this group at
> http://groups.google.com/group/paste-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Paste Users" group.
To post to this group, send email to paste...@googlegroups.com.
To unsubscribe from this group, send email to paste-users+unsubscribe@googlegroups.com.
Just a reminder: restkit contain some wsgi proxy
http://benoitc.github.com/restkit/api/restkit.contrib.wsgi_proxy-module.html
Advantages:
- use some C code to parse http response (http-parser)
- stream content (does not return a 1Go string if you proxying a divx)
- allow to use gevent to maintain a pool of socket
>>> > paste-users...@googlegroups.com.
>>> > For more options, visit this group at
>>> > http://groups.google.com/group/paste-users?hl=en.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Paste Users" group.
>>> To post to this group, send email to paste...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> paste-users...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/paste-users?hl=en.
>>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Paste Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/paste-users/-/6Nsoz7X34d4J.
>
> To post to this group, send email to paste...@googlegroups.com.
> To unsubscribe from this group, send email to
> paste-users...@googlegroups.com.
--
Mike Orr <slugg...@gmail.com>
It's nice because I can deal with the same data structure for client
calls as what i'm using on the server. So getting familiar with one
API for both sides.
I don't have to learn requests.Request or urllib.Request
Thomas G. Willis
--
Mike Orr <slugg...@gmail.com>
As part of my messing around I managed some middleware to do that.
https://github.com/twillis/webobtoolkit/blob/master/webobtoolkit/filters.py#L149
It wasn't much code at all.
since send_request_app is just a wsgi application, you can apply all
the middleware you want to build up the functionality you would want
in a client.
My stab at what a functional client might be is to automatically
decode gzip responses and ask for gzip, cookie support, and logging
the request/response I find handy often. which resulted in this
function
https://github.com/twillis/webobtoolkit/blob/master/webobtoolkit/client.py#L10
Thomas G. Willis