TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How do I write good API client libraries?

2 点作者 jnankin超过 10 年前
I&#x27;m writing some new API client libraries in a variety of languages (PHP, Java, Ruby, C#, JS, Python) for an API.<p>Is there a list of best practices or a good resource for doing this? Both in general, and language specific?<p>Here are somethings I&#x27;d expect to see in such a resource: - How to handle instantiation of the library (static functions with static API credentials vs new instances of the library with instance variables for API credentials) - How to pass binary files - Using required arguments for required parameters of an API operation vs a hash or dictionary - How to name function calls - How to structure code&#x2F;classes in relation to the API&#x27;s design - What good client libraries should return or throw as an exception ... and so on

暂无评论

暂无评论