This source file includes following definitions.
- PathForRequest
- SpecForRequest
#include "net/http/http_util.h"
#include "base/logging.h"
#include "net/base/net_util.h"
namespace net {
std::string HttpUtil::PathForRequest(const GURL& url) {
DCHECK(url.is_valid() && (url.SchemeIsHTTPOrHTTPS() ||
url.SchemeIsWSOrWSS()));
if (url.has_query())
return url.path() + "?" + url.query();
return url.path();
}
std::string HttpUtil::SpecForRequest(const GURL& url) {
DCHECK(url.is_valid() && (url.SchemeIsHTTPOrHTTPS() || url.SchemeIs("ftp") ||
url.SchemeIsWSOrWSS()));
return SimplifyUrlForRequest(url).spec();
}
}