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 class
VRequest.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 protected
VRequest(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.Builder
build(Request.Method method, java.lang.String url)
Create a new instance of builder with a method and url.java.lang.String
getBody()
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.Method
getMethod()
Returns the method type of the request.org.apache.http.HttpHost
getProxy()
Returns the proxy set to be used for the request or default to fetcher if none specified.SleepScheduler
getSleepScheduler()
Returns information about the amount of sleep before this request is made.java.lang.String
getUrl()
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:Request
Returns the method type of the request.
-
getBody
public final java.lang.String getBody()
Description copied from interface:Request
Returns the request body of the request or null if none specified.
-
getUrl
public final java.lang.String getUrl()
Description copied from interface:Request
Returns the url of the request.
-
getHeaders
public final java.util.Map<java.lang.String,java.lang.String> getHeaders()
Description copied from interface:Request
Returns the headers set for the request.- Specified by:
getHeaders
in interfaceRequest
- Returns:
- a map of the headers set
-
getProxy
public final org.apache.http.HttpHost getProxy()
Description copied from interface:Request
Returns 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:Request
Returns information about the amount of sleep before this request is made.- Specified by:
getSleepScheduler
in interfaceRequest
- Returns:
- an instance of SleepScheduler
-
-