import { Headers } from '../../lib/headers/Headers.js';
import { ResponseRedirect } from '../../models/ResponseRedirect.js';
/**
 * Reads a port number for a connection.
 *
 * @param port Existing information about the port.
 * @param protocol Request protocol. Only used if `port` is not set.
 * @return A port number. Default to 80.
 */
export declare function getPort(port: number | string, protocol?: string): number;
/**
 * Creates a value for host header.
 *
 * @param value An url to get the information from.
 * @return Value of the host header
 */
export declare function getHostHeader(value: string): string | undefined;
/**
 * Adds the `content-length` header to current request headers list if
 * it's required.
 * This function will do nothing if the request do not carry a payload or
 * when the content length header is already set.
 *
 * @param method HTTP request method
 * @param buffer Generated message buffer.
 * @param headers A headers object where to append headers when needed
 */
export declare function addContentLength(method: string, buffer: Buffer, headers: Headers): void;
export declare interface RedirectOptions {
    /**
     * true if redirect is required
     */
    redirect?: boolean;
    /**
     * If true the redirected request has to be a GET request.
     */
    forceGet?: boolean;
    /**
     * location of the resource (redirect uri)
     */
    location?: string;
}
/**
 * Checks if redirect is required.
 * @param status Response status code
 * @param method Request HTTP method
 * @param location Location header value, if any
 * @returns The redirect options
 */
export declare function redirectOptions(status: number, method: string, location?: string): RedirectOptions;
/**
 * Checks if request is an infinite loop.
 * @param location Redirect location
 * @param redirects List of response objects
 * @return True if redirect is into the same place as already visited.
 */
export declare function isRedirectLoop(location: string, redirects: ResponseRedirect[]): boolean;
/**
 * Processes redirection location
 *
 * @param location Redirect location
 * @param requestUrl Request url
 * @return Redirect location
 */
export declare function getRedirectLocation(location: string, requestUrl: string): string | undefined;
//# sourceMappingURL=RequestUtils.d.ts.map