Package ai.preferred.venom.request
Class VRequest
- java.lang.Object
-
- ai.preferred.venom.request.VRequest
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVRequest.Builder<T extends VRequest.Builder<T>>A builder for VRequest class.-
Nested classes/interfaces inherited from interface ai.preferred.venom.request.Request
Request.Method
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedVRequest(VRequest.Builder<?> builder)Constructs an instance of venom request.VRequest(java.lang.String url)Constructs an instance of venom request.VRequest(java.lang.String url, java.util.Map<java.lang.String,java.lang.String> headers)Constructs an instance of venom request.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VRequest.Builderbuild(Request.Method method, java.lang.String url)Create a new instance of builder with a method and url.java.lang.StringgetBody()Returns the request body of the request or null if none specified.java.util.Map<java.lang.String,java.lang.String>getHeaders()Returns the headers set for the request.Request.MethodgetMethod()Returns the method type of the request.org.apache.http.HttpHostgetProxy()Returns the proxy set to be used for the request or default to fetcher if none specified.SleepSchedulergetSleepScheduler()Returns information about the amount of sleep before this request is made.java.lang.StringgetUrl()Returns the url of the request.
-
-
-
Constructor Detail
-
VRequest
public VRequest(java.lang.String url)
Constructs an instance of venom request.- Parameters:
url- The url for this request.
-
VRequest
public VRequest(java.lang.String url, java.util.Map<java.lang.String,java.lang.String> headers)Constructs an instance of venom request.- Parameters:
url- The url for this requestheaders- The headers to append for this request
-
VRequest
protected VRequest(VRequest.Builder<?> builder)
Constructs an instance of venom request.- Parameters:
builder- An instance of builder
-
-
Method Detail
-
build
public static VRequest.Builder build(Request.Method method, java.lang.String url)
Create a new instance of builder with a method and url.- Parameters:
method- Request methodurl- Request url- Returns:
- A new instance of builder
-
getMethod
public final Request.Method getMethod()
Description copied from interface:RequestReturns the method type of the request.
-
getBody
public final java.lang.String getBody()
Description copied from interface:RequestReturns the request body of the request or null if none specified.
-
getUrl
public final java.lang.String getUrl()
Description copied from interface:RequestReturns the url of the request.
-
getHeaders
public final java.util.Map<java.lang.String,java.lang.String> getHeaders()
Description copied from interface:RequestReturns the headers set for the request.- Specified by:
getHeadersin interfaceRequest- Returns:
- a map of the headers set
-
getProxy
public final org.apache.http.HttpHost getProxy()
Description copied from interface:RequestReturns the proxy set to be used for the request or default to fetcher if none specified.
-
getSleepScheduler
public final SleepScheduler getSleepScheduler()
Description copied from interface:RequestReturns information about the amount of sleep before this request is made.- Specified by:
getSleepSchedulerin interfaceRequest- Returns:
- an instance of SleepScheduler
-
-