HttpPut put = new HttpPut(uri); put.setEntity(((HttpPut) method).getEntity()); put.setHeaders(method.getAllHeaders()); method = put; } else if (method instanceof HttpGet) {
private String doPut(URI uri, HttpEntity entity) throws DigitalOceanException, RequestUnsuccessfulException { HttpPut put = new HttpPut(uri); put.setHeaders(requestHeaders); if (null != entity) { put.setEntity(entity); } return executeHttpRequest(put); }
private String doPut(URI uri, HttpEntity entity) throws DigitalOceanException, RequestUnsuccessfulException { HttpPut put = new HttpPut(uri); put.setHeaders(requestHeaders); if (null != entity) { put.setEntity(entity); } return executeHttpRequest(put); }
@Override public String put(URI uri, Header[] headers, HttpEntity body) throws IOException, SpotifyWebApiException { assert (uri != null); assert (!uri.toString().equals("")); final HttpPut httpPut = new HttpPut(); httpPut.setURI(uri); httpPut.setHeaders(headers); httpPut.setEntity(body); String responseBody = getResponseBody(execute(httpPut)); httpPut.releaseConnection(); return responseBody; }
private static HttpResponse doPut(String resource, String body, Header[] headers, String base) throws Exception { DefaultHttpClient client = new DefaultHttpClient(); HttpPut put = new HttpPut(base + resource); if (headers != null) { put.setHeaders(headers); } if (body != null) { put.setEntity(new StringEntity(body)); } return client.execute(put); }
HttpPut put = new HttpPut(uri); put.setEntity(((HttpPut) method).getEntity()); put.setHeaders(method.getAllHeaders()); method = put; } else if (method instanceof HttpGet) {
HttpPut put = new HttpPut(uri); put.setEntity(((HttpPut) method).getEntity()); put.setHeaders(method.getAllHeaders()); method = put; } else if (method instanceof HttpGet) {
public static Object put(ActionContext actionContext) throws Exception{ Thing self = (Thing) actionContext.get("self"); //URI String uri = (String) self.doAction("getUri", actionContext); //log.info(uri); //HttpRequest HttpPut httpRequest = new HttpPut(uri); //headers Header[] headers = (Header[]) self.doAction("getHeaders", actionContext); if(headers != null){ httpRequest.setHeaders(headers); } //params HttpParams params = (HttpParams) self.doAction("getHttpParams", actionContext); if(params != null){ httpRequest.setParams(params); } HttpClientActions.initRequest(self, httpRequest, actionContext); return doRequest(self, httpRequest, actionContext); }