views:

33

answers:

2

I'm trying to make an http request using httplib2:

import httplib2, time, re, urllib`
conn = httplib2.Http(".cache")


page = conn.request(u"http://www.mydomain.com/search?q=cars#p=100","GET")

The response is ok, but the "#p=100" does not get passed over. Does anyone know how to pass this over with httplib2?

thanks

+6  A: 

The fragment in the URL is not passed to the server.

Ignacio Vazquez-Abrams
+1  A: 

+1 to Ignacio because he answered correctly first.
The relevant documentation, from http://tools.ietf.org/html/rfc2396#section-4.1

When a URI reference is used to perform a retrieval action on the identified resource, the optional fragment identifier, separated from the URI by a crosshatch ("#") character, consists of additional reference information to be interpreted by the user agent after the retrieval action has been successfully completed. As such, it is not part of a URI, but is often used in conjunction with a URI.

In the case of the link above, the browser uses the information after the crosshatch as a bookmark for a particular spot in the HTML.

Adam Bernier
thanks adam and ignacio, is there anyway i can programmatically use the crosshatch in python/django?
David Hsu