Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

vb.net DONET 4.6.1 - HttpRequest.GetBufferedInputStream error

$
0
0

I am receiving a json stream from Google and at

Dim Bytes = GetStreamAsByteArray(HttpContext.Current.Request.InputStream)

it -- sometimes -- errors out with "Either BinaryRead, Form, Files, or InputStream was accessed before the internal storage was filled by the caller of HttpRequest.GetBufferedInputStream."

This is an MVC REST app 

my objective is:

Dim Bytes = GetStreamAsByteArray(HttpContext.Current.Request.InputStream)
decodedString = utf8.GetString(Bytes)
jsonResulttodict = JsonConvert.DeserializeObject(Of Dictionary(Of String, Object))(decodedString)

I saw recommended... GetStreamAsByteArray(HttpContext.Current.Request.GetBufferedInputStream)

but not sure how to implement that.

Thanks


Viewing all articles
Browse latest Browse all 4850

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>