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

11
LINES

< > BotCompany Repo | #1005868 // setHeaders - add standard headers (X-Computer-ID, X-OS) to URLConnection

JavaX fragment (include)

static void setHeaders(URLConnection con) throws IOException {
  ifndef NoComputerID
  String computerID = getComputerID_quick();
  if (computerID != null) try {
    con.setRequestProperty("X-ComputerID", computerID);
    con.setRequestProperty("X-OS", System.getProperty("os.name") + " " + System.getProperty("os.version"));
  } catch (Throwable e) {
    //printShortException(e);
  }
  endifndef
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1005868
Snippet name: setHeaders - add standard headers (X-Computer-ID, X-OS) to URLConnection
Eternal ID of this version: #1005868/3
Text MD5: 0bdca52ae8bdd47ade1005be7e9cf193
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-03 13:27:18
Source code size: 409 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 529 / 706
Version history: 2 change(s)
Referenced in: [show references]