.NET Core class content acquisition request (body)

 .Net Core body for multiple reads, opened a parameter EnableRewind (), this parameter is turned on before the first reading the body, after the body information can be read many times; core era canceled before stream.position = 0 writing, reading many online stream are replaced by the following manner, pro-test, is really no problem, however. . . After a large amount of data, the data will be truncated, indicating that such an approach is wrong, in fact, still say to a value that can be read, although the byte [] = new byte [lCLength.Value] than in lCLength.Value 1024 syntax is not wrong, but to read the stream, then a maximum of 1024, if one needs to read is greater than 1024, also does not complain, truncate, information is read insufficiency.

 

 So update the following wording:

 

 Each read finished, remember actionContext.HttpContext.Request.Body.Position = 0; otherwise not read the contents of the next oh

Guess you like

Origin www.cnblogs.com/zhuangjolon/p/11572411.html