From 1e3e3af5a261d5d3e616c5ccd24160727510a777 Mon Sep 17 00:00:00 2001 From: Chris Lamprecht Date: Tue, 27 Dec 2011 14:32:47 -0600 Subject: [PATCH] Removing scheme and netloc from urlunsplit so the resulting HTTP GET request is just "GET /v1/..." rather than "GET http://api.indextank.com/v1...". This makes the python client work while testing against the REST API in django "runserver" mode. --- indextank/client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indextank/client.py b/indextank/client.py index 8f7b3a6..44985f6 100644 --- a/indextank/client.py +++ b/indextank/client.py @@ -415,7 +415,8 @@ def _request(method, url, params={}, data={}, headers={}): else: port = 80 - url = urlparse.urlunsplit((scheme, netloc_noauth, path, query, fragment)) + # don't include scheme or netloc because we want a relative url path + url = urlparse.urlunsplit(('', '', path, query, fragment)) if method in ['GET', 'DELETE']: params = urllib.urlencode(params, True) if params: