简体   繁体   中英

Android - Http library retrofit vs okhttp3

I wish to create an api for http requests on android. I used volley before, but it causes some problems about headers. It removes content-length from headers. It doesn't fit http standardization.

So I wish to try another library. Many users suggest Retrofit. But retrofit requires a model. In my case the model is not defined. Because I expect url, body, headers and method. I don't know the data. Retrofit is not a good choice for me. Am I right?

I think I should use okhttp3.

Volley adds extra headers

Yes, good choice. Go with okhttp3 library, I am using this library for past a year now. As you said it doesn't require any models and in addition to that it have regular updation, bug fix upgrades available... 👍🏻👍🏻👍🏻Got for it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM