algolia / algolia/algoliasearch-client-java
Discussion regarding `HttpTransport` exposed methods
- 主要语言
- Java
- 星标
- 52
- 派生
- 33
- PR 合并指标
- 30 天内没有已合并 PR
描述
> I think introducing helpers in "HttpTransport" would make the code in callers more straightforward. Let's introduce "HttpTransport.doGet(Async)", "HttpTransport.doPost(Async)", "HttpTransport.doPut(Async)", "HttpTransport.doDelete(Async)" - performing corresponding HTTP operations and setting the call type ~appropriately (eg READ for GET, WRITE otherwise - with the possibility for "doPost" to override it to "READ", or have a doPostForRead or something like that). This would also permit to remove the necessity of giving null data on GET, (doGet wouldn't take a "data" argument). As a second step, it could make sense to make requestAsync private.
Not really sure about this one! We have lots of combination with the endpoints such as. POST/READ/data:null, POST/WRITE/data or GET/READ/data:null. I fear that introducing an helper would reduce the "flexibility" of the transporter. I would prefer to keep it like this. WDYT @Anthony Seure?
Moreover, an overload is available for null data (I forgot to use it in getLogs() :D). So you can perform an executeRequestAsync without passing "null" explicitly as data : Example: POST without data.
cc @Ant-hem @BenoitPerrot
贡献指南
这个仓库没有索引到贡献指南
调研方向
先阅读 HttpTransport 及其 executeRequestAsync 重载,然后检查 getLogs() 等调用方,以及讨论中描述的端点组合。确定特定操作的辅助方法是否保留了现有的 POST/READ、POST/WRITE 和 GET/READ 灵活性;只有在 API 形态以及任何 requestAsync 可见性变更都达成一致并得到一致应用后,工作才算完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- api
- Issue 类型
- 重构
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100