/** * Returns the request line. * * @param conn the {@link HttpConnection connection} used to execute * this HTTP method * * @return The request line. */ private String getRequestLine(HttpConnection conn) { return HttpMethodBase.generateRequestLine(conn, getName(), getPath(), getQueryString(), this.effectiveVersion.toString()); }
getPath(), conn.isSecure(), state.getCookies()); if ((cookies != null) && (cookies.length > 0)) { if (getParams().isParameterTrue(HttpMethodParams.SINGLE_COOKIE_HEADER)) {
public String getURI() { return method == null ? null : method.getPath().toString(); }
public String getURL() { return this.method == null ? null : this.method.getPath().toString(); }
private static String constructUri(HttpMethodBase request) { try { return request.getURI().toString(); } catch (URIException e) { return request.getPath(); } }
public String toString() { StringBuilder sb = new StringBuilder(getClass().getSimpleName()); sb.append("[Method=").append(method.getName()); sb.append("\n\tHTTP version=").append(method.getEffectiveVersion()); sb.append("\n\tstatus code=").append(method.getStatusCode()); sb.append("\n\tpath=").append(method.getPath()); sb.append("\n\tquery string=").append(method.getQueryString()); sb.append("\n\tresponse charset=").append(getResponseCharset()); Header[] responseHeaders = method.getResponseHeaders(); sb.append("\n\tresponse headers="); for (Header header : responseHeaders) { sb.append(header.toExternalForm()); } sb.append("]"); return sb.toString(); } }
static public void showHttpRequestInfo(Formatter f, HttpMethodBase m) { f.format("HttpClient request %s %s %n", m.getName(), m.getPath()); f.format(" do Authentication=%s%n", m.getDoAuthentication()); f.format(" follow Redirects =%s%n", m.getFollowRedirects()); f.format(" effectiveVersion =%s%n", m.getEffectiveVersion()); f.format(" hostAuthState =%s%n", m.getHostAuthState()); HttpMethodParams p = m.getParams(); f.format(" cookie policy =%s%n", p.getCookiePolicy()); f.format(" http version =%s%n", p.getVersion()); f.format(" timeout (msecs) =%d%n", p.getSoTimeout()); f.format(" virtual host =%s%n", p.getVirtualHost()); f.format("Request Headers = %n"); Header[] heads = m.getRequestHeaders(); for(int i = 0;i < heads.length;i++) f.format(" %s", heads[i]); f.format("%n"); }
/** * Returns the request line. * * @param conn the {@link HttpConnection connection} used to execute * this HTTP method * * @return The request line. */ private String getRequestLine(HttpConnection conn) { return HttpMethodBase.generateRequestLine(conn, getName(), getPath(), getQueryString(), this.effectiveVersion.toString()); }
/** * Returns the request line. * * @param conn the {@link HttpConnection connection} used to execute * this HTTP method * * @return The request line. */ private String getRequestLine(HttpConnection conn) { return HttpMethodBase.generateRequestLine(conn, getName(), getPath(), getQueryString(), this.effectiveVersion.toString()); }
} else if (x instanceof ConnectException) { ConnectException ctx = new ConnectException("Connection refused " + httpRequest.getPath()); ctx.setStackTrace(x.getStackTrace()); throw ctx;
/** * Returns the request line. * * @param conn the {@link HttpConnection connection} used to execute * this HTTP method * * @return The request line. */ private String getRequestLine(HttpConnection conn) { return HttpMethodBase.generateRequestLine(conn, getName(), getPath(), getQueryString(), this.effectiveVersion.toString()); }
private String executeMethod(HttpMethodBase request, IProgressMonitor monitor) throws ReviewboardException { monitor = Policy.monitorFor(monitor); ensureIsLoggedIn(monitor); try { monitor.beginTask("Executing request", IProgressMonitor.UNKNOWN); int statusCode = executeRequest(request, monitor); if ( statusCode == HttpStatus.SC_NOT_FOUND ) throw new ReviewboardResourceNotFoundException(request.getPath()); return getResponseBodyAsString(request, monitor); } finally { request.releaseConnection(); monitor.done(); } }
/** * Returns the request line. * * @param conn the {@link HttpConnection connection} used to execute * this HTTP method * * @return The request line. */ private String getRequestLine(HttpConnection conn) { return HttpMethodBase.generateRequestLine(conn, getName(), getPath(), getQueryString(), this.effectiveVersion.toString()); }
/** * Returns the request line. * * @param conn the {@link HttpConnection connection} used to execute * this HTTP method * * @return The request line. */ private String getRequestLine(HttpConnection conn) { return HttpMethodBase.generateRequestLine(conn, getName(), getPath(), getQueryString(), this.effectiveVersion.toString()); }
getPath(), conn.isSecure(), state.getCookies()); if ((cookies != null) && (cookies.length > 0)) { if (getParams().isParameterTrue(HttpMethodParams.SINGLE_COOKIE_HEADER)) {
getPath(), conn.isSecure(), state.getCookies()); if ((cookies != null) && (cookies.length > 0)) { if (getParams().isParameterTrue(HttpMethodParams.SINGLE_COOKIE_HEADER)) {
getPath(), conn.isSecure(), state.getCookies()); if ((cookies != null) && (cookies.length > 0)) { if (getParams().isParameterTrue(HttpMethodParams.SINGLE_COOKIE_HEADER)) {
getPath(), conn.isSecure(), state.getCookies()); if ((cookies != null) && (cookies.length > 0)) { if (getParams().isParameterTrue(HttpMethodParams.SINGLE_COOKIE_HEADER)) {