AnsweredAssumed Answered

how to setup qualys session cookie in Java HttpURLConnection?

Question asked by Gary Dai on Dec 9, 2011
Latest reply on Dec 9, 2011 by Eric Perraudeau

Hey,

  I'm working on a java program to run Qualys reports. However I get 401 error when the LUANCH request is sent out. The session cookie retrieved from LOGIN http request is added back to LUANCH http request using the following java statement:

  httpURLConnection.setRequestProperty("Cookie", "QualysSession=...");

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  The URL is https://qualysapi.qualys.com/api/2.0/fo/report/ .

  I also provide an "X-Requested-With" as

 

  httpURLConnection.setRequestProperty(

"X-Requested-With", "Java Demo");

 

  Thanks,

 

 

 

Outcomes