Java should not be encouraged net. Httpurlconnection, because org apache. http. client. Is httpclient better?

I still see people using httpurlconnection to communicate with websites The forum also has many issues related to httpurlconnection Now, httpclient from Apache can realize almost all the functions that httpurlconnection can achieve, with less code, clearer and more efficient My question is,

>As developers, should we discourage the use of httpurlconnection? > Is there a use case where httpurlconnection is better than httpclient?

Solution

No, I wouldn't look like that

For very simple use cases where httpurlconnection works well, I won't include any dependencies for a few lines of clearer code

For any other case, I would say, use httpclient

The above is collected by the programming house for you. The use of Java should not be encouraged net. Httpurlconnection, because org apache. http. client. Is httpclient better? I hope the article can help you solve the problem. The use of Java should not be encouraged net. Httpurlconnection, because org apache. http. client. Is httpclient better? Program development problems encountered.

If you think the content of the programming home website is good, you are welcome to recommend the programming home website to programmers and friends.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>