News for hackers. Stuff that matters.
Re:Ask HN: Best Way to Mock APIs in 2020? by paledot on Sunday June 14, 2020 @10:25AM (#23517833)
All good points, but you missed the most important part: in any mature programming language, you're not implementing the HttpClient yourself: it's a library, package, bundle, whatever. Which means that when you mock that you're not missing out on testing any code that you wrote, and the project that maintains your HttpClient (hopefully) has their own community-maintained test suite.
Re:Ask HN: Best Way to Mock APIs in 2020? by berkes on Sunday June 14, 2020 @11:59AM (#23518703)
Have a look at VCR. It was developed for Ruby, and does exactly that: mock out the actual HTTP part of your HTTPClient.

It does this by first making the actual request and then storing that record in a plain YAML file (which you can alternatively generate yourself, by hand or from an openapi spec)

Have a look at "Ports in Other Languages" in their README to find the VCR port for your language, framework or stack.