Source:
<code>public ZestResponse send(ZestRequest req) throws IOException { final HttpRequestBase method; switch (req.getMethod()) { case "GET": method = new HttpGet(req.getUrl().toString()); break; case "POST": method = new HttpPost(req.getUrl().toString()); break; case "OPTIONS": method = new HttpOptions(req.getUrl().toString()); break; case "HEAD": method = new HttpHead(req.getUrl().toString()); break; case "PUT": method = new HttpPut(req.getUrl().toString()); break; case "DELETE": method = new HttpDelete(req.getUrl().toString()); break; case "TRACE": method = new HttpTrace(req.getUrl().toString()); break; default: throw new IllegalArgumentException("Method not supported: " + req.getMethod()); } method.setConfig(defaultRequestConfig); setHeaders(method, req.getHeaders()); for (ZestCookie zestCookie : req.getZestCookies()) { BasicClientCookie cookie = new BasicClientCookie(zestCookie.getName(), zestCookie.getValue()); cookie.setDomain(zestCookie.getDomain()); cookie.setPath(zestCookie.getPath()); cookie.setExpiryDate(zestCookie.getExpiryDate()); cookie.setSecure(zestCookie.isSecure()); httpContext.getCookieStore().addCookie(cookie); } if (method instanceof HttpEntityEnclosingRequestBase) { final HttpEntity requestBody = new StringEntity(req.getData()); final HttpEntityEnclosingRequestBase methodWithEntity = (HttpEntityEnclosingRequestBase) method; methodWithEntity.setEntity(requestBody); } int code = 0; String responseHeader = null; String responseBody = null; Date start = new Date(); try { debug(req.getMethod() + ": " + req.getUrl()); final HttpResponse response = httpClient.execute(method, httpContext); code = response.getStatusLine().getStatusCode(); responseHeader = response.getStatusLine().toString() + "\r\n" <START> + arrayToStr(method.getAllHeaders()); <END> final HttpEntity responseEntity = response.getEntity(); if (responseEntity != null) { responseBody = EntityUtils.toString(responseEntity); } } finally { method.releaseConnection(); } req.setHeaders(arrayToStr(httpContext.getRequest().getAllHeaders())); return new ZestResponse( req.getUrl(), responseHeader, responseBody, code, new Date().getTime() - start.getTime()); }</code><technical_language>response instead of method</technical_language>

Target:
public ZestResponse send(ZestRequest req) throws IOException { HttpRequestBase method; switch (req.getMethod()) { case "GET": method = new HttpGet(req.getUrl().toString()); break; case "POST": method = new HttpPost(req.getUrl().toString()); break; case "OPTIONS": method = new HttpOptions(req.getUrl().toString()); break; case "HEAD": method = new HttpHead(req.getUrl().toString()); break; case "PUT": method = new HttpPut(req.getUrl().toString()); break; case "DELETE": method = new HttpDelete(req.getUrl().toString()); break; case "TRACE": method = new HttpTrace(req.getUrl().toString()); break; default: throw new IllegalArgumentException("Method not supported: " + req.getMethod()); } method.setConfig(defaultRequestConfig); setHeaders(method, req.getHeaders()); for (ZestCookie zestCookie : req.getZestCookies()) { BasicClientCookie cookie = new BasicClientCookie(zestCookie.getName(), zestCookie.getValue()); cookie.setDomain(zestCookie.getDomain()); cookie.setPath(zestCookie.getPath()); cookie.setExpiryDate(zestCookie.getExpiryDate()); cookie.setSecure(zestCookie.isSecure()); httpContext.getCookieStore().addCookie(cookie); } if (method instanceof HttpEntityEnclosingRequestBase) { HttpEntity requestBody = new StringEntity(req.getData()); HttpEntityEnclosingRequestBase methodWithEntity = (HttpEntityEnclosingRequestBase) method; methodWithEntity.setEntity(requestBody); } int code = 0; String responseHeader = null; String responseBody = null; Date start = new Date(); req.setTimestamp(start.getTime()); try { debug(req.getMethod() + ": " + req.getUrl()); HttpResponse response = httpClient.execute(method, httpContext); code = response.getStatusLine().getStatusCode(); responseHeader = response.getStatusLine().toString() + "\r\n" + arrayToStr(response.getAllHeaders()); HttpEntity responseEntity = response.getEntity(); if (responseEntity != null) { responseBody = EntityUtils.toString(responseEntity); } } finally { method.releaseConnection(); } req.setHeaders(arrayToStr(httpContext.getRequest().getAllHeaders())); return new ZestResponse( req.getUrl(), responseHeader, responseBody, code, new Date().getTime() - start.getTime()); }