Title: Make usage of http clients (apache, OkHttp, Jetty, Asynch) easier · Issue #343 · cloudinary/cloudinary_java · GitHub
Open Graph Title: Make usage of http clients (apache, OkHttp, Jetty, Asynch) easier · Issue #343 · cloudinary/cloudinary_java
X Title: Make usage of http clients (apache, OkHttp, Jetty, Asynch) easier · Issue #343 · cloudinary/cloudinary_java
Description: Feature request for Cloudinary Java SDK General idea: making the settings of http client library to be used easier for consumers of the SDK, by enabling configuration via new Cloudinary(...) constructor. Explain your use case I want to u...
Open Graph Description: Feature request for Cloudinary Java SDK General idea: making the settings of http client library to be used easier for consumers of the SDK, by enabling configuration via new Cloudinary(...) constr...
X Description: Feature request for Cloudinary Java SDK General idea: making the settings of http client library to be used easier for consumers of the SDK, by enabling configuration via new Cloudinary(...) constr...
Opengraph URL: https://github.com/cloudinary/cloudinary_java/issues/343
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Make usage of http clients (apache, OkHttp, Jetty, Asynch) easier","articleBody":"## Feature request for Cloudinary Java SDK\r\n\r\nGeneral idea: making the settings of http client library to be used easier for consumers of the SDK,\r\nby enabling configuration via `new Cloudinary(...)` constructor.\r\n\r\n## Explain your use case\r\nI want to use plain java http client, instead of Apache one.\r\n\r\n## Describe the problem you’re trying to solve\r\nIn `Cloudinary.loadStrategies()` there's a fixed list of strings with classnames, which a consumer of the SDK can't change.\r\nThis means even if I provide my own strategy, this will not loaded and I still being forced to add dependency for apache http.\r\n(hint: technically: when the class `om.cloudinary.http5.ApiStrategy` is not found, an `UnknownError` is thrown, which is bad)\r\n\r\nAlso this brings me to another point: the constructor of Cloudinary should better accept Configuration object, instead of `Map config`. It's very annoying for me as an SDK user, to provide a Map with configs. \r\nI get no auto-completion on Maps and must find details in either source code or documentation (which is just cumbersome).\r\nSo I don't know immediately what config options are available, that I could e.g. provide HTTP proxy address.\r\n\r\n(Sorry, if I mix two problems here ... I came to these two, when I thought about a solution proposal, below)\r\n\r\n## Do you have a proposed solution?\r\nYES.\r\nThe constructor of Cloudinary.class (or better the Configuration.class) could have some new field `apiStrategy` of type `class\u003cAbstractApiStrategy\u003e`. And another one for the UploadStrategy.\r\nThen, the loadStragies() method will not load by name (which can contain typos), but rather by class(type) directly.\r\n\r\nOn the second problem, adding a new (overloaded) constructor to Cloudinary is easy to add, but that's not sufficient.\r\nIdeally, the Configuration class will provide a convenient Builder function, so users of the SDK are better guided,\r\nand plausibility checks can easier be implemented.\r\n\r\nI'm happy to provide a PR, if this resonates with you.","author":{"url":"https://github.com/nitram509","@type":"Person","name":"nitram509"},"datePublished":"2024-10-03T20:45:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/343/cloudinary_java/issues/343"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cb68a145-edf8-85cb-2c10-fa6a8924952a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8B86:2B9D24:C7DE31:10A5C35:697C3786 |
| html-safe-nonce | bd4a95c322071749737fb3245233e6d173032010b29c0d801c1d72760f38993d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Qjg2OjJCOUQyNDpDN0RFMzE6MTBBNUMzNTo2OTdDMzc4NiIsInZpc2l0b3JfaWQiOiI4Nzc3ODUxOTY3MTU5MTU0NTY2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 366c6f1f316cd60be01b2d1a3f123fcc52db72a985e94c1679d2b0eb91b28946 |
| hovercard-subject-tag | issue:2564973443 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/cloudinary/cloudinary_java/343/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ddc53d0fcddd92e3d667b8610b9472125f547c0bc292332a4699eac6e9a95081/cloudinary/cloudinary_java/issues/343 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ddc53d0fcddd92e3d667b8610b9472125f547c0bc292332a4699eac6e9a95081/cloudinary/cloudinary_java/issues/343 |
| og:image:alt | Feature request for Cloudinary Java SDK General idea: making the settings of http client library to be used easier for consumers of the SDK, by enabling configuration via new Cloudinary(...) constr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nitram509 |
| hostname | github.com |
| expected-hostname | github.com |
| None | da4f0ee56809799586f8ee546b27f94fe9b5893edfbf87732e82be45be013b52 |
| turbo-cache-control | no-preview |
| go-import | github.com/cloudinary/cloudinary_java git https://github.com/cloudinary/cloudinary_java.git |
| octolytics-dimension-user_id | 1460763 |
| octolytics-dimension-user_login | cloudinary |
| octolytics-dimension-repository_id | 6179800 |
| octolytics-dimension-repository_nwo | cloudinary/cloudinary_java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 6179800 |
| octolytics-dimension-repository_network_root_nwo | cloudinary/cloudinary_java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 787d8d274e314f52ce6d846c7581f9476d8dc736 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width