Questions tagged [content-length]

Entity-header field indicates the size of the entity-body.

The Content-Length entity-header field indicates the size of the entity-body, in decimal number of OCTETs, sent to the recipient or, in the case of the HEAD method, the size of the entity-body that would have been sent had the request been a GET.

374 questions
2
votes
4 answers

Finding the Length of a Specific Column in a 2-Dimensional List

In Python 3, if I have a 2-dimensional list in which the last row is not completely filled out (example below), how do I get the length of a specific column? [[1, 2, 3,], [4, 5, 6,], [7, 8,]] For example, columns 0 and 1 have length of 3, but…
2
votes
0 answers

content-length header in response not present despite commenting transfer-encoding in axis2.xml

I have an axis2 service running on TOMCAT 6.0.18 with axis2 1.3 version. I disabled chunking by commenting the transfer-encoding element and changed the HTTP to 1.0 as shown below:
2
votes
0 answers

Setting Content-Length header with PHP filesize() gives ERR_SPDY_PROTOCOL_ERROR in Chrome

I'm on a shared hosting site, using Apache 2.2.22 and PHP 7.0.27, gzipped output. Reading a file with PHP and setting the headers with header("Content-Length: ".filesize($filename)); gives ERR_SPDY_PROTOCOL_ERROR when viewed in Chrome, with the SSL…
Samuli
  • 21
  • 2
2
votes
2 answers

why is cURL not reading full @file and setting Content-Length: 8186?

I am using cURL on Windows 7 to test a RESTful API. My data is in a JSON file that is 16,987 characters long. When I do not set the content length cURL assumes Content-Length: 8186 and does not send the entire JSON payload. I get Unexpected…
PMorganCA
  • 730
  • 6
  • 24
2
votes
3 answers

Unexpected http/net response content length in Golang

I am making a HTTP Get request using the code below. I proxy it through Fiddler to analyse the request. The request seems to be being made correctly, with the expected response. However, the resp.ContentLength property of the response in GO is -1…
Jordan
  • 904
  • 2
  • 12
  • 32
2
votes
2 answers

How to check the field 'Content-Length ' of an HTTP request using Ruby on Rails 3?

I am using Ruby on Rails 3 and in a my view file I have this code: <%= form_for (@account, ...) do |f| %> <%= f.file_field :file %> ... <%= f.submit "Upload" %> <% end %> In order to avoid an overloading of the server, I would check the size…
user502052
  • 14,803
  • 30
  • 109
  • 188
2
votes
2 answers

content-length in HttpURLConnection

I'm trying to send a body in x-www-form-urlencoded to my local Web API. I can make GET without any problems. Here is what I do: String urlParameters =…
BeGreen
  • 765
  • 1
  • 13
  • 39
2
votes
0 answers

Specifying additional headers for each part of multipart request in Postman

I'm implementing multi-part file upload with the following library: Commons FileUpload Since the files may be too large, I don't load the entire file to the the memory, I just do the job on the bytes as fast as they arrive. The problem that I have…
dvelopp
  • 4,095
  • 3
  • 31
  • 57
2
votes
0 answers

ASP.NET Web API Content Length Check without reading whole content

I have a web api endpoint which accepts some files as content body. In the endpoint I am checking the content size, and if it exceeds the 10MB file size, I am rejecting the request. For other endpoint we need to accept different file size limits.…
2
votes
0 answers

Wget can't download a complete file in ubuntu

I was using wget to download a file,like this: wget link/file.zip the file.zip was about 100M, but I just receive 5552B: and whatever I downloaded(large than 5552B, from some other hosts), I just receive 5552B! The HTTP response header…
SunnyMarkLiu
  • 93
  • 1
  • 3
  • 10
2
votes
1 answer

Spring RestTemplate Large Files ContentLength Auto Changed

Got a question on RestTemplate with Large Files. Is there a max content length and/or does it automatically get changed despite explicitly being set? I have a file that is 5GB that I want to send to my CDN (Akamai) via HTTP PUT command. I've set it…
abeauchamp
  • 825
  • 2
  • 18
  • 29
2
votes
1 answer

How to change the HTTP response content length header in Java Filter

I have written a Java HTTP Response filter in which I am modifying the HTTP response body. Since I am changing the HTTP responce body, I have to update the http content-length header filed in response in accordance with new content. I am doing it in…
KItis
  • 5,476
  • 19
  • 64
  • 112
2
votes
1 answer

HttpWebResponse is wrong for the ContentLength

I have a download method for HTTP protocol. But it seems it doesnt work correctly, something is wrong. I tested it with some url sources and it was correct except the last one. The ContentLength property is wrong for the url. It is shown as 210 kb…
Ali Tor
  • 2,772
  • 2
  • 27
  • 58
2
votes
0 answers

Cordova file transfer fails when Content-Length is not returned

iOS: When a file is compressed and Content-Length is not returned by the server, a HEAD request is sent to get the Content-Length. Unfortunately some firewalls and servers with compression set to 'force' compress the response and remove the…
2
votes
1 answer

angularjs - how i can get the content-length header

i'm doing a http GET request to a url which has a xml file and i need to get the response header 'Content-Lenght' ? Is there any way to get it? i must validate the size of the file before been abel to download it. Here's my code $http({ method…
Franco Manzur
  • 373
  • 1
  • 7
  • 19