From 6f58f153b5d043ae1d6ce3dbb947f445a036e10b Mon Sep 17 00:00:00 2001 From: "adrian.f.cole" Date: Sun, 9 Aug 2009 22:40:35 +0000 Subject: [PATCH] added constructor that accepts http headers git-svn-id: http://jclouds.googlecode.com/svn/trunk@1842 3d8758e0-26b5-11de-8745-db77d3ebf521 --- .../main/java/org/jclouds/http/HttpRequest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/core/src/main/java/org/jclouds/http/HttpRequest.java b/core/src/main/java/org/jclouds/http/HttpRequest.java index 034438adbb..71d4476d2b 100644 --- a/core/src/main/java/org/jclouds/http/HttpRequest.java +++ b/core/src/main/java/org/jclouds/http/HttpRequest.java @@ -32,6 +32,7 @@ import org.jclouds.command.Request; import com.google.common.collect.Multimap; import com.google.inject.internal.Lists; +import com.google.inject.internal.Nullable; /** * Represents a request that can be executed within {@link HttpCommandExecutorService} @@ -70,6 +71,20 @@ public class HttpRequest extends HttpMessage implements Request { setHeaders(checkNotNull(headers, "headers")); } + /** + * + * @param endPoint + * This may change over the life of the request due to redirects. + * @param method + * If the request is HEAD, this may change to GET due to redirects + */ + public HttpRequest(HttpMethod method, URI endPoint, Multimap headers, + @Nullable Object entity) { + this(method, endPoint); + setHeaders(checkNotNull(headers, "headers")); + setEntity("entity"); + } + @Override public String toString() { final StringBuilder sb = new StringBuilder();