I am trying to write small code to access URL. Trouble is I am able to do it from browser but not from Java code. I can see browser setting and there is nothing much apart from Automatic proxy configuration URL.
In Firefox --> Tool -->options --> Advanced --> Network --> Connection --> Setting --> Automatic proxy configuration URL,
Basically whatever request we are sending is going via this proxy URL
Is there way we can use this proxy configuration URL in Java so Browser like capabilities can be achieved.
I am sure this is not new problem hence I am even fine with link to the already answered post. Please suggest.
Good news. now I am able to get the response. But what still amazes me what is it happening behind the scene, I believe it will be worth knowing...
What I did is I use API called Proxy-vole. If it will help anybody please visit below url where I find the solution.
Now Java code
This class is using Proxy-Vale API Which I use in my main class
This is mine main class. Please see line number 29 where I have confusion on its working.
Please stop using so much color in your post. It makes it unpleasant to read. If you want people's help, you should be making it easy for them to read your posts, not hard. Colors, bold, etc. should be used sparingly and only for emphasis or association, not for full paragraphs or posts.
Thanks Surlac. I have not gone there so far to satisfy my curiosity as I am stuck in another problem here. Still banging head to look for the solution.
As per my Last my post I am getting the response. Next challenge is to get the response for the attribute and value in the URL. I have tried couple of ways but somehow it’s not going anywhere.
I have form in a webpage that I want to populate using java code and submit. In response I will get the same webpage with some data related to inputs like current time, date, user name entered in the form etc.
In the form there are some input data of type hidden fields. And I am not sure of the significance but I also see one input hidden field outside the form.
I am getting success in hitting the url and getting the response but I am not getting success in passing the fields. Its from with post method.
I tried HTTP client it keep coming back with
“java.net.SocketException: Unknown proxy type : HTTP”
Other options somehow sending wrong info to URL which redirecting me to Error page
Any suggestion from where I should start.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop