From: Vasudevan C. <vco...@gm...> - 2018-12-03 17:55:02
|
Hi Ronald, Thanks for your reply. Unfortunately, I have only Clojure Code. I am copying the snippet of the code for your reference. (start-page (do (enable-javascript false) (enable-httpexception false) ; Disable the HTTP and script exceptions (enable-scriptexception false) ; Disable the script exceptions (.setUseInsecureSSL (.getOptions *wc*) true) ; (let [a-token (nth @dchannel_authtoken index) st1-data (.addRequestHeader *wc* "Authorization" (str "bearer " a-token)) st2-data (.addRequestHeader *wc* "Referer" ref-url) st3-data (.addRequestHeader *wc* "Accept" "application/pdf") ] ) pdf-url) Explanation: Start-page creates a Web Client Instance with BrowserVersion Set to FIREFOX_60. Rest of the code self-explanatory. I watched the Charles Trace and found that Authorization & Referer are set but not Accept. Accept was having the default value I presume "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8". Thanks for your quick reply. Regards Vasu On Mon, 3 Dec 2018 at 22:51, Ronald Brill <rb...@rb...> wrote: > Hi Vasu, > > do you have some sample code for me. Will then try to reproduce (and fix) > > RBRi > > On Mon, 3 Dec 2018 20:14:50 +0530 Vasudevan Comandur wrote: > > > >All, > > > > I was trying to migrate my app from htmlunit 2.23 to htmlunit 2.33. > > > > As part of the app, I was setting the "Accept" using addRequestHeader > >method > > to "application/pdf". The header was not getting set. > > > > I am setting the Browser_Version to FIREFOX_60. > > > > The same call was working fine in 2.23. Am I missing something?. > > > > Looking forward to hearing from you. > > > >Regards > > Vasu > > > > > > > >----< Inline text [text-plain-04.txt] >------------------ > > > > > > > > > >----< Inline text [text-plain-05.txt] >------------------ > > > >_______________________________________________ > >Htmlunit-user mailing list > >Htm...@li... > >https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > > > |