A redirect that uses 307 see other.

@param url The url used as redirect target.
@return A nicely configured result with status code 307 and the url set
as Location header.
10052
public Result redirectTemporary(String url) {
        status(Status.TEMPORARY_REDIRECT);
        with(HeaderNames.LOCATION, url);
        return this;
    }
1265556
function redirect(url) {
  // unset headers
  const { res } = this;
  res
    .getHeaderNames()
    .filter(name => !name.match(/^access-control-|vary|x-amz-/i))
    .forEach(name => res.removeHeader(name));

  this.set("Location", url);

  // status
  if (!statuses.redirect[this.status]) this.status = 302;

  if (this.status === 302) {
    const redirect = new S3Error("Found", "Resource Found");
    redirect.description = "302 Moved Temporarily";
    this.body = redirect.toHTML();
    this.type = "text/html";
  } else {
    this.body = "";
    this.type = "";
  }
}
1108327
private Response followPostRedirect(Response response) throws IOException {
    String location = response.header("Location");
    if (location == null) {
      throw new IllegalStateException(format("Missing HTTP header 'Location' in redirect of %s", response.request().url()));
    }
    HttpUrl url = response.request().url().resolve(location);

    // Don't follow redirects to unsupported protocols.
    if (url == null) {
      throw new IllegalStateException(format("Unsupported protocol in redirect of %s to %s", response.request().url(), location));
    }

    Request.Builder redirectRequest = response.request().newBuilder();
    redirectRequest.post(response.request().body());
    response.body().close();
    return okHttpClient.newCall(redirectRequest.url(url).build()).execute();
  }
1265265
public static SamlEndpoint ofHttpRedirect(URI uri) {
        requireNonNull(uri, "uri");
        return new SamlEndpoint(uri, SamlBindingProtocol.HTTP_REDIRECT);
    }
775057
function get (url, cb) {
  var urls = [], end
  _get(url, cb)
  function _get (url) {
    urls.push(url)
    if(end) return
    if(urls.length > 5)
      cb(end = new Error('too many redirects\n'+JSON.stringify(urls)))

    console.error('GET', url)
    ;(/^https/.test(url) ? https : http).get(url, function next (res) {

      if(res.statusCode >= 300 && res.statusCode < 400)
        _get(res.headers.location)
      else {
        end = true,
        cb(null, res)
      }
    })
    .on('error', function (err) {
      if(!end)
        cb(end = err)
    })
  }
}
591530
public static void sendRedirect(
		HttpServletResponse response,
		String location,
		int status
	) throws IllegalStateException, IOException {
		// Response must not be committed
		if(response.isCommitted()) throw new IllegalStateException("Unable to redirect: Response already committed");

		response.setHeader("Location", location);
		response.sendError(status);
	}
946289
def get(url, referer = nil)
      limit = redirect_limit
      loc = url
      loop do
        # if redirected to a relative url, merge it with the host of the original
        # request url
        loc = url.merge(loc) if loc.relative?

        response, response_time = get_response(loc, referer)
        code = Integer(response.code)
        redirect_to =
          begin
            response.is_a?(Net::HTTPRedirection) ? URI(response['location']).normalize : nil
          rescue URI::InvalidURIError => e
            @opts[:logger].debug { "Request #{url} got #{e}" } if @opts[:logger]
            nil
          end
        yield response, code, loc, redirect_to, response_time
        limit -= 1
        break unless (loc = redirect_to) && allowed?(redirect_to, url) && limit > 0
      end
    end
1275575
def redirect(uri, *args)
      if env['HTTP_VERSION'] == 'HTTP/1.1' and env["REQUEST_METHOD"] != 'GET'
        status 303
      else
        status 302
      end

      # According to RFC 2616 section 14.30, "the field value consists of a
      # single absolute URI"
      response['Location'] = uri(uri, settings.absolute_redirects?, settings.prefixed_redirects?)
      halt(*args)
    end
618965
public void redirect(String location, int statusCode) {
        checkCommitted();
        finalizeResponse();

        status(statusCode);
        header(HttpConstants.Header.LOCATION, location);
        header(HttpConstants.Header.CONNECTION, "close");
        try {
            httpServletResponse.sendError(statusCode);
        } catch (IOException e) {
            throw new PippoRuntimeException(e);
        }
    }
1125841
def redirect(url, code=303):
    
    scriptname = request.environ.get('SCRIPT_NAME', '').rstrip('/') + '/'
    location = urljoin(request.url, urljoin(scriptname, url))
    raise HTTPResponse("", status=code, header=dict(Location=location))
1106654
public static String getHostFromURL(String url) {
		URL u = toURL(url);
		String host = (u == null) ? "" : u.getHost();
		return host;
	}
673520
public void sendRedirect(String url) 
        throws IOException
    {
        if (url==null)
            throw new IllegalArgumentException();
        
        if (!URI.hasScheme(url))
        {
            StringBuffer buf = _servletHttpRequest.getHttpRequest().getRootURL();
            if (url.startsWith("/"))
                buf.append(URI.canonicalPath(url));
            else
            {
                String path=_servletHttpRequest.getRequestURI();
                String parent=(path.endsWith("/"))?path:URI.parentPath(path);
                url=URI.canonicalPath(URI.addPaths(parent,url));
                if (!url.startsWith("/"))
                    buf.append('/');
                buf.append(url);
            }
            
            url=buf.toString();
        }
        
        resetBuffer();
        
        _httpResponse.setField(HttpFields.__Location,url);
        _httpResponse.setStatus(HttpResponse.__302_Moved_Temporarily);
        complete();
    }
1210967
public static void redirect(HttpServletRequest request, HttpServletResponse response,
                               String url) throws IOException {
        String redirectUrl;

        if (url.startsWith("/")) {
            redirectUrl = request.getContextPath() + url;
        } else {
            redirectUrl = url;
        }

        logger.debug("Redirecting to URL: {}", redirectUrl);

        response.sendRedirect(redirectUrl);
    }
297203
public static URI urlToURI(URL url) {
    try {
      return url.toURI();
    }
    catch (URISyntaxException e) {
      throw LOG.cannotConvertUrlToUri(url, e);
    }
  }
823377
def getURIWithRedirect(self, url):
        ''''''
        tries = 0
        while tries < 5:
                conn = httplib.HTTPConnection(self.server)
                conn.request("GET", url)
                r1 = conn.getresponse()
                if r1.status in [301, 302, 303, 307]:
                    location = r1.getheader('Location')
                    if self.debug:
                        print("redirect from %s to %s" % (url, location))
                    url = location
                    conn.close()
                    tries += 1
                    continue
                data = r1.read()
                conn.close()
                if sys.version_info.major < 3:
                    return data
                else:
                    encoding = r1.headers.get_content_charset(default)
                    return data.decode(encoding)
        return None
455230
function redirect($url, $type = 303) {
		if ($type == 303) {
			// 303 See Other
			$this->responseCode(303);
		}
		else if ($type == 301) {
			// 301 Moved Permanently
			$this->responseCode(301);
		}
		else if ($type == 307) {
			// 307 Temporary Redirect
			$this->responseCode(307);
		}

		// redirect to...
		$this->header("Location: $url");
	}
1209480
public static SamlEndpoint ofHttpRedirect(String uri) {
        requireNonNull(uri, "uri");
        try {
            return ofHttpRedirect(new URI(uri));
        } catch (URISyntaxException e) {
            return Exceptions.throwUnsafely(e);
        }
    }