public class HttpClient extends Client
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CRLF |
java.net.Proxy |
proxy
Proxy to use, defaults to none.
|
static java.lang.String |
SERVER_URL |
API_VERSION, DEFAULT_TIMEOUT, DEFAULT_TOKEN_TIMEOUT, DFLT_POLL_INTERVAL, isVerbose, LEN_POLLS_INTERVAL, POLLS_INTERVAL, SOFTWARE_VENDOR_ID| Constructor and Description |
|---|
HttpClient(java.lang.String username,
java.lang.String password) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes opened connections (if any), cleans up resources.
|
boolean |
connect()
Opens API-specific connection if not opened yet.
|
Captcha |
getCaptcha(int id)
Fetches an uploaded CAPTCHA details.
|
User |
getUser()
Fetches user details.
|
boolean |
report(int id)
Reports an incorrectly solved CAPTCHA
|
Captcha |
upload(byte[] img) |
Captcha |
upload(byte[] img,
int type,
byte[] banner,
java.lang.String banner_text) |
Captcha |
upload(byte[] img,
java.lang.String challenge,
int type,
byte[] banner,
java.lang.String banner_text) |
Captcha |
upload(byte[] img,
java.lang.String challenge,
int type,
byte[] banner,
java.lang.String banner_text,
java.lang.String grid)
Uploads a CAPTCHA to the service.
|
Captcha |
upload(int type,
org.json.JSONObject json) |
decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, getBalance, getCaptcha, getPollInterval, getText, getText, load, report, upload, upload, upload, uploadpublic static final java.lang.String CRLF
public static final java.lang.String SERVER_URL
public java.net.Proxy proxy
public HttpClient(java.lang.String username,
java.lang.String password)
Client.Client(String, String)public void close()
Clientclose in class ClientClient.close()public boolean connect()
throws java.io.IOException
Clientconnect in class Clientjava.io.IOExceptionClient.connect()public User getUser() throws java.io.IOException, Exception
ClientgetUser in class Clientjava.io.IOExceptionExceptionClient.getUser()public Captcha upload(byte[] img, java.lang.String challenge, int type, byte[] banner, java.lang.String banner_text, java.lang.String grid) throws java.io.IOException, Exception
Clientupload in class Clientimg - CAPTCHA image byte vectorjava.io.IOExceptionExceptionClient.upload(byte[], java.lang.String, int, byte[], java.lang.String, java.lang.String)public Captcha upload(byte[] img, java.lang.String challenge, int type, byte[] banner, java.lang.String banner_text) throws java.io.IOException, Exception
public Captcha upload(byte[] img, int type, byte[] banner, java.lang.String banner_text) throws java.io.IOException, Exception
public Captcha upload(int type, org.json.JSONObject json) throws java.io.IOException, Exception
upload in class Clientjava.io.IOExceptionExceptionfor noCaptchas by Tokenpublic Captcha getCaptcha(int id) throws java.io.IOException, Exception
ClientgetCaptcha in class Clientid - CAPTCHA IDjava.io.IOExceptionExceptionClient.getCaptcha(int)public boolean report(int id)
throws java.io.IOException,
Exception
Clientreport in class Clientid - CAPTCHA IDjava.io.IOExceptionExceptionClient.report(int)