The value for one of the HTTP headers is not in the correct format Error

NagendraPrasad Gangu 50 Reputation points
2024-11-08T08:34:46.24+00:00

Hi Team,

we are following the below approach to upload a file to Azure storage container.

Create File : Empty File ( It is loading fine)

Put Range : This is always failing with invalid header value :

HeaderName>Content-Length</HeaderName><HeaderValue>11</HeaderValue></

Below is the sample Payload going to Put Range method

Azure Storage
Azure Storage
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,538 questions
{count} votes

Accepted answer
  1. Keshavulu Dasari 4,840 Reputation points Microsoft External Staff Moderator
    2024-11-12T17:35:04.98+00:00

    Hi NagendraPrasad Gangu,
    As discussed on this:https://learn.microsoft.com/en-us/answers/questions/2116758/invalid-header-value-error-when-calling-put-range

    <ns26:StandardHTTPHeaders>
    
      <ns26:Content-Length>0</ns26:Content-Length>
    
    </ns26:StandardHTTPHeaders>
    
    <ns26:CustomHTTPHeaders>
    
      <ns26:x-ms-version>2023-01-03</ns26:x-ms-version>
    
      <ns26:x-ms-type>file</ns26:x-ms-type>
    
      <ns26:x-ms-file-creation-time>now</ns26:x-ms-file-creation-time>
    
      <ns26:x-ms-file-last-write-time>now</ns26:x-ms-file-last-write-time>
    
      <ns26:x-ms-content-length>11</ns26:x-ms-content-length>
    
      <ns26:Content-Length>0</ns26:Content-Length>
    
    </ns26:CustomHTTPHeaders>
    
    

    Put Range

    nstrgmpr:HTTPHeaders

    <ns35:CustomHTTPHeaders>
    
      <ns35:x-ms-range>bytes=0-10</ns35:x-ms-range>
    
      <ns35:x-ms-version>2023-01-03</ns35:x-ms-version>
    
      <ns35:x-ms-write>update</ns35:x-ms-write>
    
      <ns35:Content-Length>11</ns35:Content-Length>
    
    

    User's image Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members. 

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.