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
1 answer

How not to let python requests calculate content-length and use the provided one?

We have some custom module where we have redefined open, seek, read, tell functions to read only a part of file according to the arguments. But, this logic overrides the default tell and python requests is trying to calculate the content-length…
GP92
  • 433
  • 1
  • 12
  • 30
2
votes
0 answers

Jersey response: don't set Content-Length header if Transfer-Encoding is already set

I have a Jersey-Application that proxies a request to an internal application, which should be out of direct access. @GET @Path("/path") public static Response get( @Context UriInfo uriinfo, @Context HttpHeaders httpHeaders, …
ulrich
  • 1,431
  • 3
  • 17
  • 46
2
votes
0 answers

Warning: POST Content-Length of 10467213 bytes exceeds the limit of 8388608 bytes in Unknown on line 0

I am receiving this content length error, however I do have checks in place when user tries to upload an image by checking if it goes over a specified max-image size. Here is my code: //file size of the chosen image $file_size =…
dark_illusion_909099
  • 1,067
  • 2
  • 21
  • 41
2
votes
3 answers

PHP CURL: HTTP/1.1 411 Length Required

Even I have specified the Content Length, I still receive the error: Length Required HTTP Error 411. The request must be chunked or have a content length. This is my code $curl = curl_init(); $data = array("Key" => "Value", "Key2" =>…
dwing265
  • 120
  • 1
  • 13
2
votes
4 answers

Is there any way I can see how long a JQuery AJAX call takes to execute?

Is there anyway to see how long a simple $.getJSON method takes to call using some type of timing code, in jquery/javascript? Secondly, is there any way to see how BIG the response Content-Length is, in kB or megabytes?
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
2
votes
1 answer

How to set response Content-Length to infinite

I try to create an application in web2py framework. By default web2py server has Transfer-Encoding: Chunked header for response, but in that case when target remote web application sends GET request to my app it could get only first string of text…
2
votes
2 answers

How do I calculate the content-length of a file upload in ruby?

I need to include the content-length of a image /png file posted in an upload to a webservice. But how do I calculate the content-length to include in the header? Thanks. I am submitting it using rest-client. The webservice for the upload is…
Satchel
  • 16,414
  • 23
  • 106
  • 192
2
votes
2 answers

Content-Length header not returned from Pylons response

I'm still struggling to Stream a file to the HTTP response in Pylons. In addition to the original problem, I'm finding that I cannot return the Content-Length header, so that for large files the client cannot estimate how long the download will…
EMP
  • 59,148
  • 53
  • 164
  • 220
2
votes
0 answers

unable to get content-length header working under rails 4.1+puma

Setup is: Puma: 2.9.1 Rails: 4.1.5 Rack: 1.5.2 As per documentation i tried to get ContentLength header working by adding fallowing to my application.rb config.middleware.use Rack::ContentLength Unfortunately response was still chunked. After some…
user124
  • 1,632
  • 1
  • 11
  • 11
2
votes
3 answers

How to calculate Content-Length for a file download within Kohana PHP?

I'm trying to send a file from within a Kohana model to the browser, but as soon as I add a Content-Length header, the file doesn't start downloading right away. Now the problem seems to be that Kohana is already outputting buffers. An ob_clean at…
user309349
  • 21
  • 3
2
votes
1 answer

When and where does Play set the Content-Length header?

I'm trying to log every request my play app is receiving using the Common Log Format. I can get all of these fields in a Filter just fine except for body length. I noticed that making a call to Play return the Content-Length since Play…
Nacht
  • 10,488
  • 8
  • 31
  • 39
2
votes
1 answer

Refused to set unsafe header Connection/Content-length

I'm working on a website and I have a problem right here. On the page I'm working, the user puts an ip address and the ports he wants to be searched. This is being made with ajax (user side) and php (server side). Ajax sends the ip and port (one by…
mathiaz
  • 21
  • 1
  • 1
  • 2
2
votes
1 answer

Limit body content-length in a request in Node.js

The code is simple. I'm only interested in the first part of the source code of youtube.com and I'd like to stop downloading data when content-length is higher than 10000, for example. I've been trying to do it with no success. Any ideas? var…
alex_unio
  • 325
  • 5
  • 13
2
votes
1 answer

PHP ob_gzhandler, setting Content-Length disables gzipped output

I read some articles about setting the content-length of a file that will be served. It has some benefits comparing to chunked downloads. The server serve chunks (don't know what the size of a chunk is anyway) when the content-length is unknown. In…
Codebeat
  • 6,501
  • 6
  • 57
  • 99
2
votes
0 answers

Force Apache to return Content-Length for regular PHP pages?

I am bulding an ajax website and it needs to have a percentage loader for the new pages. New pages are ajax loaded, cached and slided with animation. Anyway, in order to do that, I need to fetch somehow the size of the content I am going to receive…
barakuda28
  • 2,762
  • 6
  • 23
  • 32