locked
HttpClient and HttpRequestException RRS feed

  • General discussion

  • Hello, I have some issue with HttpClient.

    Short story:

    I want get properties of my blob with use Azure Storage Services REST API. I send HEAD request to http://<myaccount>.blob.core.windows.net/<mycontainer>/<myblob>. 

    Server returns response (from Fiddelr):

    Response from Azure REST API

    But when HttpClient tries to handle this response it raises HttpRequestException with message: 

    "Cannot write more bytes to the buffer than the configured maximum buffer size: 2147483647."  

    It is occurs because Content-Length header contains value 31457280512 (30 GB). However I don't try to retrieve content with this length, I only get header that describe size of my blob in Azure Storage.

    Thanks.

    Wednesday, May 29, 2013 10:50 AM

All replies

  • Hi,

    Did you try to use:

    client.MaxResponseContentBufferSize = veryhighvalue;

    HTH,

    Berndt

    Wednesday, May 29, 2013 11:18 AM
  • Hello,

    yes I tried it!

    However you cannot set this property to value greater than 2147483647 bytes (2 GB).

    The problem is that I do not even try to get content of this length. And I no need the buffer of this size. This behavior strangely for me.

    Wednesday, May 29, 2013 12:22 PM