set HTTP headers in WebEngine JavaFX
Asked Answered
H

1

10

How to pass the HTTP Headers like

"Accept-Language", "Accept", "Accept-Encoding" to WebEngine in JavaFX? i have tried the method as specified in Setting a cookie using JavaFX's WebEngine/WebView, but it doesn't work. is there any API that is being exposed in Java 8 for achieving this? Pls suggest.

Herbst answered 8/9, 2014 at 10:34 Comment(5)
Your question is possible duplicate, see answer here: #13803980Kersten
Thanks @Kersten - Still there're no docs or links to specify how to set http headers other than User-Agent. Has that been made possible with JavaFX 8? I browsed through the link , but couldn't find any relevant methods.Herbst
you are right, it doesn't seem to be possible to set other headers than user agent. However, it might be possible to set the http headers by implementing a custom protocol handlerKersten
Actually the only way i found, was it: twitter.com/CodingFabian/status/524942996748652544Famed
look:#36917969Aurie
P
2

Since JDK 8u60 the default locale of the application is automatically added to the "Accept-Language" header as the first option. This may help in some cases although it would of course be better to be able to set all these headers explicitly.

Perfidy answered 2/8, 2015 at 9:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.