
aQute.bnd.http.HttpRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of biz.aQute.bndlib Show documentation
Show all versions of biz.aQute.bndlib Show documentation
bndlib: A Swiss Army Knife for OSGi
The newest version!
package aQute.bnd.http;
import java.io.File;
import java.lang.reflect.Type;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import org.osgi.util.promise.Promise;
import aQute.bnd.service.url.TaggedData;
import aQute.lib.converter.TypeReference;
import aQute.service.reporter.Reporter;
/**
* Builds up a request
*
* @param
*/
public class HttpRequest {
String verb = "GET";
boolean isIdemPotent = true;
Object upload;
Type download;
Map headers = new HashMap<>();
long timeout = -1;
HttpClient client;
String ifNoneMatch;
long ifModifiedSince;
long ifUnmodifiedSince;
URL url;
int redirects = 10;
String ifMatch;
boolean cached;
long maxStale;
Reporter reporter;
File useCacheFile;
boolean updateTag;
int retries;
long retryDelay;
HttpRequest(HttpClient client) {
this.client = client;
this.retries = client.retries;
this.retryDelay = client.retryDelay;
}
/**
* Convert the result to a specific type
*/
@SuppressWarnings("unchecked")
public HttpRequest get(Class type) {
this.download = type;
return (HttpRequest) this;
}
/**
* Convert the result to a specific type
*/
@SuppressWarnings("unchecked")
public HttpRequest get(TypeReference type) {
this.download = type.getType();
return (HttpRequest) this;
}
/**
* Convert the result to a specific type
*/
@SuppressWarnings("unchecked")
public HttpRequest
© 2015 - 2025 Weber Informatics LLC | Privacy Policy