Hacker News new | ask | show | jobs
by mdaniel 870 days ago
I would expect an API is a set of things one could call, and a protocol is the sequence of things that one must, should, or can do in order to be in compliance with what the other party in the protocol is expecting to happen

HTTP is a protocol because one cannot just socket.write whatever bytes they want and have any good outcome, whereas socket.write is an API that is available in a hypothetical library