Package ai.preferred.venom.request
Class HttpFetcherRequest
- java.lang.Object
-
- ai.preferred.venom.request.HttpFetcherRequest
-
- All Implemented Interfaces:
Request,Unwrappable
public class HttpFetcherRequest extends java.lang.Object implements Request, Unwrappable
- Author:
- Maksim Tkachenko, Truong Quoc Tuan, Ween Jiann Lee
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHttpFetcherRequest.DiagnosticsThis class contains the diagnostic information for this request.-
Nested classes/interfaces inherited from interface ai.preferred.venom.request.Request
Request.Method
-
-
Constructor Summary
Constructors Constructor Description HttpFetcherRequest(Request innerRequest)Constructs an instance of http fetcher request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetBody()Returns the request body of the request or null if none specified.HttpFetcherRequest.DiagnosticsgetDiagnostics()Get diagnostic information for this request.java.util.Map<java.lang.String,java.lang.String>getHeaders()Returns the headers set for the request.RequestgetInner()Returns the unwrapped version of this 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.HttpFetcherRequestprependHeaders(java.util.Map<java.lang.String,java.lang.String> preHeaders)Prepend headers to the current headers.HttpFetcherRequestsetProxy(org.apache.http.HttpHost proxy)Sets proxy to be used for this request.
-
-
-
Constructor Detail
-
HttpFetcherRequest
public HttpFetcherRequest(Request innerRequest)
Constructs an instance of http fetcher request.- Parameters:
innerRequest- An instance of underlying request
-
-
Method Detail
-
prependHeaders
public final HttpFetcherRequest prependHeaders(java.util.Map<java.lang.String,java.lang.String> preHeaders)
Prepend headers to the current headers.- Parameters:
preHeaders- Headers to be prepended- Returns:
- A new instance of http fetcher request
-
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.
-
setProxy
public final HttpFetcherRequest setProxy(org.apache.http.HttpHost proxy)
Sets proxy to be used for this request.- Parameters:
proxy- Proxy to be used for this request- Returns:
- A new instance of http fetcher request
-
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
-
getInner
public final Request getInner()
Description copied from interface:UnwrappableReturns the unwrapped version of this request.- Specified by:
getInnerin interfaceUnwrappable- Returns:
- an instance of request
-
getDiagnostics
public final HttpFetcherRequest.Diagnostics getDiagnostics()
Get diagnostic information for this request.- Returns:
- A instance of diagnostics
-
-