Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 13th, 2004, 07:45 AM
roypython roypython is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 71 roypython User rank is Lance Corporal (50 - 100 Reputation Level)roypython User rank is Lance Corporal (50 - 100 Reputation Level)roypython User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 h 20 m 49 sec
Reputation Power: 10
mod_python

Hello.
Your help is very appreciated
I am building a web app that works as follows:
1.It will get requests from client(mod-python)
2.Generates a request to another web server
( by re-writing the url and attaching the client's headers)
3. Send the response to the client(mod-python)

My problem is with headers:
a. Trying to read the headers from the client generates error,
I'm using :
def handler(req):
x= req.headers_in()
The error:
TypeError: 'mp_table' object is not callable
I didn't find any other way to do it in mod_python
b. I there a way to internally redirect the request from the client,
so that automatically the headers will be included in the new request?
(so that all that is needed to be changed is just the url)
[ I tried using req.internal_redirect("www.google.com"), but
it throws an error:
File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 85, in __getattr__
raise AttributeError, attr

AttributeError: internal_redirect

c. Because internal_redirect failes, I am trying to use alternatives such
as as using the urllib.

Thanks
Roy

Reply With Quote
  #2  
Old May 13th, 2004, 04:34 PM
roypython roypython is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 71 roypython User rank is Lance Corporal (50 - 100 Reputation Level)roypython User rank is Lance Corporal (50 - 100 Reputation Level)roypython User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 h 20 m 49 sec
Reputation Power: 10
1. req.headers_in is a field not method, so:
req.write(str(req.headers_in))
2. An internal redirect can only be to a path on your server, not an outside
one


Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > mod_python

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap