public Request createRequest(String url) { return super.createRequest(url) .setSession(this) .setCookies(getCookies(url)); }
protected Response(Request request, HttpURLConnection connection) { this.connection = connection; this.request = request; if (request.session != null) request.session.appendCookies(parseCookies()); }
@Override public Request createRequest(String url) { return super.createRequest(url).setSession(session); }
public static Request createRequest(String url) { if (session == null) session = new HttpSession(); return session.createRequest(url); }
public T data(byte[] data, String contentType) { this.data = data; method = ConnectionMethod.POST; setContentType(contentType); return self(); }
public List<Cookie> getCookies() { if (request.session != null) return request.session.getCookies(connection.getURL()); else return parseCookies(); }
public T timeout(int ms) { this.connectTimeout = ms; this.readTimeout = ms; return self(); }
public String getUrl() { try { return createURL(url, params); } catch (UnsupportedEncodingException e) { return url; } }
public long headerLong(String key, long def) { try { return headerLong(key); } catch (NumberFormatException e) { return def; } }
@Override public void accept(String s) { reference.value = reducer.reduce(reference.value, s); } });
public int headerInt(String key, int def) { try { return headerInt(key); } catch (NumberFormatException e) { return def; } }
public Request createRequest(String url) { return super.createRequest(url) .setSession(this) .setCookies(getCookies(url)); }
public static Request createRequest(String url) { if (session == null) session = new HttpSession(); return session.createRequest(url); }
protected Response(Request request, HttpURLConnection connection) { this.connection = connection; this.request = request; if (request.session != null) request.session.appendCookies(parseCookies()); }
@Override public Request createRequest(String url) { return super.createRequest(url).setSession(session); }
public T timeout(int ms) { this.connectTimeout = ms; this.readTimeout = ms; return self(); }
public String getUrl() { try { return createURL(url, params); } catch (UnsupportedEncodingException e) { return url; } }
public long headerLong(String key, long def) { try { return headerLong(key); } catch (NumberFormatException e) { return def; } }