code: def _proxy(self, url, urlparams=None):
          for k,v in request.params.iteritems():
              urlparams[k]=v
          query = urlencode(urlparams)
          full_url = url
          if query:
              if not full_url.endswith("?"):
                  full_url += "?"
              full_url += query
          req = urllib2.Request(url=full_url)
          for header in request.headers:
              if header.lower() == "host":
                  req.add_header(header, urlparse.urlparse(url)[1])
              else:
                  req.add_header(header, request.headers[header])
          res = urllib2.urlopen(req)
          i = res.info()
          response.status = res.code
          got_content_length = False
          for header in i:
              if header.lower() == "transfer-encoding":
                  continue
              if header.lower() == "content-length":
                  got_content_length = True
              response.headers[header] = i[header]
          result = res.read()
          res.close()
          return result