473,563 Members | 2,709 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: Retrieving http headers from HTTPConnection object

On Mon, Sep 1, 2008 at 1:06 PM, jorma kala <jj****@gmail.c omwrote:
Hi,

when using httplib for http requests, like for example:
conn = httplib.HTTPCon nection("www.py thon.org")
conn.request("G ET", "/index.html")

Is it possible to retrieve the complete http request in string form :
GET /index.html HTTP/1.1
Host: www.python.org
User-Agent: ...
Accept: ...
Accept-Language:
Accept-Encoding:
Accept-Charset:
Keep-Alive:
Connection:

I mean does the HTTPConnection object have a property that stores this ?
or is it retrievable by some other form?

Thanks a lot.
--
Looking at the code of HTTPConnection, all that goes through the
_output message (including, therefore, the putheaders) are appended to
the self._buffer list.

Regards
Marco

--
Marco Bizzarri
http://notenotturne.blogspot.com/
http://iliveinpisa.blogspot.com/
Sep 1 '08 #1
0 881

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8568
by: SPG | last post by:
Hi, I have a servlet application that I am trying to write a very basic load tester for. There application has several servlets, but all rely on the same session being used (IE: For logged in users etc). I am trying to write a little test app to test the workflow of the servlet application. The problem is I need to keep the same session...
2
1526
by: Raaijmakers, Vincent (GE Infrastructure) | last post by:
Please tell me if this is true or not.. In a all my applications I used the old fashioned way of "POST" requests: params = urllib.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0}) headers = {"Content-type": "application/x-www-form-urlencoded"} conn = httplib.HTTPConnection("somelocation") conn.request("POST", "/cgi-bin/query", params, headers)...
3
3176
by: John Reese | last post by:
Hello there. I've run into some missing functionality with HTTP Digest authentication in the 2.3 library and I was wondering if I'm just missing something. Missing functionality the first: urllib2 1a. You can add "handlers" to your opener indicating that you want to use HTTP Digest auth. This is nice way to handle it, but I don't see...
3
1311
by: Eric Pederson | last post by:
I didn't come across any illuminating discussion via Google, thus my question here (though it may be a neophyte question.) I am interested in the workings under the hood of Python's access of "files". What is actually happening at the various stages when I create a file object and "read" it? (1) >>> f = file("C:/GuidosParrot.txt","r") ...
0
7583
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7885
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7638
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7948
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.