sonatype / ossindex-public

Sonatype OSS Index - Public
Apache License 2.0
6 stars 9 forks source link

Implement a Transport based on OkHttp #7

Closed sschuberth closed 2 years ago

sschuberth commented 5 years ago

OkHttp is a very popular HTTP library. As it's likely already in use in a user's dependency stack, it would be nice to have a Transport implementation that uses OkHttp so that such users don't need to introduce a dependency on another HTTP library.

sschuberth commented 3 years ago

Are there any plans to work on this from your side @ndonewar or @jdillon?

jdillon commented 3 years ago

@sschuberth I have no plans to do so do not know about @ndonewar and the OSSIndex team however.

It its pretty simple (last I recall) to implement a transport impl, then interface only has 2 methods:

https://github.com/sonatype/ossindex-public/blob/master/client/src/main/java/org/sonatype/ossindex/service/client/transport/Transport.java

I would expect if a user preferred to use OkHttp-impl instead of the provided Apache HttpClient or HttpUrlConnection implementations they would implement this as they need.

If you want to avoid any extra HTTP library you can exclude the httpclient dependencies and use the HttpUrlConnection transport.

ndonewar commented 3 years ago

Hi @sschuberth - we have no plans at this time.

sschuberth commented 2 years ago

I'm closing this in favor of the OkHttp / Retrofit based client we now have at https://github.com/oss-review-toolkit/ort/tree/main/clients/oss-index.