Java https: // request: HTTPclient or (command-line + curl)?

I need to make some cookie requests at https: // URL. I know how to do this from the command line using cURL, and would like to automate it using Java.

I am watching HTTPClient and I am completely confused. It seems like a lot of rough programming would be required. Is there any reason why I should continue this line?

Another way is to execute the cURL executable from Java, which seems to be easier if it were more painful.

+3
source share
2 answers

See their guide on Using SSL , from what I can tell, this is the same HttpClient 4.x, except that it uses a slightly different 4.x syntax (see an example of this syntax ). In other words, if you changed “http” in this example to “https”, this will work fine. If you looked at this tutorial , I can understand why you think this is harder than necessary. However, this is only necessary if the root certificate of the site you are trying to access is not a accepted JVM certificate.

, do, , . , , curl, , , , , , .

, HttpClient, ?

, , , . , , :— , , , , , . , , , .

, HttpClient, , , , - .

: , , . , - JDK.

+2

Jetty + SSL

, , .

0

Source: https://habr.com/ru/post/1768732/


All Articles