Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

11
LINES

< > BotCompany Repo | #1004102 // loadPageWithUserAgent

JavaX fragment (include)

sbool loadPageWithUserAgent_verbose;

static S loadPageWithUserAgent(S url, S userAgent) ctex {
  URL tURL = new URL(url);
  URLConnection conn = tURL.openConnection();
  conn.setRequestProperty("User-Agent", userAgent);
  loadPage_anonymous = true;
  if (loadPageWithUserAgent_verbose)
    print("Loading as " + userAgent + ": " + hideCredentials(url));
  ret loadPage(conn, tURL);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, ekrmjmnbrukm, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1004102
Snippet name: loadPageWithUserAgent
Eternal ID of this version: #1004102/3
Text MD5: d9d18ad36739c2752d66276dc72333ef
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-09-23 14:00:37
Source code size: 394 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 562 / 606
Version history: 2 change(s)
Referenced in: #1006314 - loadPageWithUserAgentAndTimeout
#1006654 - Standard functions list 2 (LIVE, continuation of #761)