Modifier | Constructor and Description |
---|---|
protected |
Builder(Request.Method method,
String url) |
Modifier and Type | Method and Description |
---|---|
T |
addHeader(String name,
String value)
Adds header to be used
|
T |
addHeaders(Map<String,String> headers)
Add headers to be used
|
VRequest |
build()
Builds the request with the options specified.
|
static VRequest.Builder |
delete(String url)
Creates a new instance of builder with method type delete.
|
static VRequest.Builder |
get(String url)
Creates a new instance of builder with method type get.
|
static VRequest.Builder |
head(String url)
Creates a new instance of builder with method type head.
|
static VRequest.Builder |
options(String url)
Creates a new instance of builder with method type options.
|
static VRequest.Builder |
post(String url)
Creates a new instance of builder with method type post.
|
static VRequest.Builder |
put(String url)
Creates a new instance of builder with method type put.
|
T |
removeHeader(String name) |
T |
removeHeaders() |
T |
setBody(String body)
Sets the request body to be used.
|
T |
setProxy(org.apache.http.HttpHost proxy)
Sets the proxy to be used, this will override the
proxy selected in Fetcher for this request.
|
T |
setSleepScheduler(SleepScheduler scheduler)
Sets the sleep scheduler to be used, this will override the
sleep scheduler defined in Crawler for this request.
|
T |
setUrl(String url)
Sets the url to be fetched.
|
protected Builder(Request.Method method, String url)
public static VRequest.Builder get(String url)
url
- url to fetch.public static VRequest.Builder post(String url)
url
- url to fetch.public static VRequest.Builder head(String url)
url
- url to fetch.public static VRequest.Builder put(String url)
url
- url to fetch.public static VRequest.Builder delete(String url)
url
- url to fetch.public static VRequest.Builder options(String url)
url
- url to fetch.public T setBody(String body)
body
- request bodypublic T setSleepScheduler(SleepScheduler scheduler)
scheduler
- sleep scheduler to be used.public T setProxy(org.apache.http.HttpHost proxy)
proxy
- proxy to be used.public T removeHeaders()
public T addHeaders(Map<String,String> headers)
This will merge with headers set in Crawler class. If a same key is found, this will override that header in Crawler class.
headers
- request headerspublic T addHeader(String name, String value)
This will merge with headers set in Crawler class. If a same key is found, this will override that header in Crawler class.
name
- name/key of the headervalue
- value of the headerpublic T setUrl(String url)
url
- url to fetch.public VRequest build()
Copyright © 2018. All rights reserved.