public interface ScrapingHttpClient
extends java.io.Closeable
Modifier and Type | Field and Description |
---|---|
static int |
REDIRECT_WITH_POST_ENTITY_STATUS_CODE |
Modifier and Type | Method and Description |
---|---|
void |
clearCookies()
Clears all cookies from this client
|
void |
close() |
ScrapingRequest.Builder |
convertScrapeableFileToRequest(ScrapeableFile scrapeableFile)
Converts the scrapeable file to the request.
|
java.util.List<ScrapingCookie> |
getCookies()
Returns a list of all the cookies for the current client, for any domain
|
ScrapingResponse |
issueRequest(ScrapingRequest request)
Issues the given request
|
ScrapingData |
scrapeFile(ScrapeableFile scrapeableFile)
Requests data for a scrapeable file.
|
void |
setCookie(ScrapingCookie cookie)
Sets the cookie
|
void |
setProxyServer(ScrapingProxy proxyServer)
Sets a proxy server to use for future requests
|
void |
updateSessionClientInfo()
Tells the client the session http info value has changed.
|
boolean |
usesHint(ScrapingHint hint)
Returns whether or not this client implementation uses the given hint.
|
static final int REDIRECT_WITH_POST_ENTITY_STATUS_CODE
@NotNull ScrapingResponse issueRequest(@NotNull ScrapingRequest request)
request
- The request to be issuedvoid setProxyServer(@Nullable ScrapingProxy proxyServer)
proxyServer
- The proxy server to use for future requestsvoid setCookie(@NotNull ScrapingCookie cookie)
cookie
- The cookie to setvoid clearCookies()
boolean usesHint(@NotNull ScrapingHint hint)
hint
- The hint to testScrapingData scrapeFile(@NotNull ScrapeableFile scrapeableFile)
scrapeableFile
- The scrapeable file to request@NotNull java.util.List<ScrapingCookie> getCookies()
ScrapingRequest.Builder convertScrapeableFileToRequest(@NotNull ScrapeableFile scrapeableFile)
return
super.convertScrapeableFileToRequest(scrapeableFile).addHeader("Cookie: " + someCookie)
scrapeableFile
- The scrapeable file to convertvoid close()
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable
void updateSessionClientInfo()