public class HTTPRequest extends Object
| Constructor and Description |
|---|
HTTPRequest(String url) |
public HTTPRequest(String url)
url - URLpublic HTTPRequest header(String name, String value)
name - the name of the headervalue - the value of the headerpublic HTTPRequest queryParam(String name, String value)
name - the name of the query parametervalue - the value of the query parameterpublic HTTPRequest pathParam(String name, String value)
name - the name of the path parametervalue - the value of the path parameterpublic HTTPRequest timeout(int newTimeout)
newTimeout - Timeout in mspublic HTTPRequest followRedirect(boolean follow)
follow - true to automatically follow redirects; false otherwisepublic HTTPRequest userAgent(String agent)
agent - the user agent string to usepublic HTTPRequest contentType(String type)
type - the Content-Typepublic HTTPRequest auth(String authString)
authString - the Authorization headerpublic HTTPRequest authBasic(String user, String password)
user - the usernamepassword - the passwordpublic HTTPRequest authBearer(String accessToken)
accessToken - the OAuth2 Bearer access tokenpublic HTTPRequest accept(String type)
type - the Accept typepublic HTTPRequest body(String bodyString)
bodyString - the body entitypublic HTTPRequest form(Map<String,String> form)
form - the form contentpublic org.apache.http.HttpResponse get()
HttpResponsepublic org.apache.http.HttpResponse put()
HttpResponsepublic org.apache.http.HttpResponse patch()
HttpResponsepublic org.apache.http.HttpResponse post()
HttpResponsepublic org.apache.http.HttpResponse delete()
HttpResponsepublic org.apache.http.HttpResponse options()
HttpResponsepublic void getAsync(HTTPResponseCallback callback)
public void putAsync(HTTPResponseCallback callback)
public void patchAsync(HTTPResponseCallback callback)
public void postAsync(HTTPResponseCallback callback)
public void deleteAsync(HTTPResponseCallback callback)
public void optionsAsync(HTTPResponseCallback callback)
Copyright © 2012-2014 Taimos GmbH. All Rights Reserved.