The last line of the method reads
await response.WriteAsync(buffer.ToString());
but Microsoft.AspNetCore.HttpResponse does not have a WriteAsync method.
It _does_ have a property Body which has a WriteAsync method but this does not have a signature supporting a string parameter.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The code works. Must be an extension method your missing.
cc @scottaddie
This requires using Microsoft.AspNetCore.Http; for the extension method.
I just went through the article again and couldn't see any mention of the requirement for using Microsoft.AspNetCore.Http. Don't you think it would be appropriate to put a comment in the code?
```
That's a change that will be picked up by #16486
Most helpful comment
This requires
using Microsoft.AspNetCore.Http;for the extension method.