Aspnetcore.docs: WriteResponseBodyAsync is wrong for 3.1

Created on 14 Apr 2020  Â·  4Comments  Â·  Source: dotnet/AspNetCore.Docs

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.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Source - Docs.ms needs-more-info

Most helpful comment

This requires using Microsoft.AspNetCore.Http; for the extension method.

All 4 comments

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

Was this page helpful?
0 / 5 - 0 ratings