i would like to have a page in pylons that can make requests to any
URL.
i don't want a full out proxy, i don't need URL rewriting or anything
complex like that.
this is the basic setup i have now:
1. i have a controller called proxy
2. you make a request in the browser to the controller/action
3. you pass in params with a URL you want to request
4. the controller makes a request to the URL, and returns the response
of it
this works for basic GETs and i even pass cookies through to the
request, but i want to also be able to POST, upload files, etc...
in the end, i would just like the proxy controller to make the request
on your behalf, passing in all the headers
it received along to the request (post, cookies, etc), and then return
the response along with all it's headers (status code, mimetype, etc)
back through pylons.
i've been using urllib2, but i haven't figured how to pass in ALL of
pylons headers to the request. when i get a response, i haven't figured
out how to pass ALL the headers of the response to pylons Response.
this is what i have in mind.....
---------------------------------------------------------------
proxyController(basicController):
def default:
#pass in all headers to request
req = Request(request.cookie['url'], request.headers)
#make the request
res = urlopen(req);
#respond, passing through all headers to response
Response(res.read(), res.headers)
---------------------------------------------------------------
thanks for your time,
-leith
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---