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
0
votes
0 answers

Sonos speakers need content-length header?

I am currently writing a DLNA server which serves streams for DMRs such as the Sonos Play 1 & 3. Accordingly to the HTTP 1.1 specification, when you do not know the actual length of a track, do not specify Content-Length, instead just specify…
user995414
  • 101
  • 1
0
votes
1 answer

Getting length of var and creating a width

I have a banner background that is complex and the text blends into it so I need to add a background to this div so it shows the text given. Is there a way using PHP that I can get the length of the text and turn it into a px so I then can use it…
Jess McKenzie
  • 8,345
  • 27
  • 100
  • 170
0
votes
0 answers

Response hangs probably because of invalid content length using netty

I have created a small HttpServer for my application. It is used for serving a sort of API and some json repsponses. All o my responses tested so far work great except for one. I use GSON for the json part. Part of my code that is handling the…
Apostolos
  • 7,763
  • 17
  • 80
  • 150
0
votes
0 answers

JAX-RS client, ProtocolException: Content-Length header already present

I have the following method: private static final String UTF_8 = "UTF-8"; private static final int TIMEOUT = 5000; private static final String DATASTREAM_URI = "MY_VALID_URL_HERE"; @Override public Response logHttpMessage(final String…
Jdruwe
  • 3,450
  • 6
  • 36
  • 57
0
votes
1 answer

How do I get current response length in CakePHP

I'm using: CakePHP 2.5.6 Trying to read the length of the response like this: App::uses('Controller', 'Controller'); Class AppController extends Controller { public function afterFilter() { parent::afterFilter(); …
Bart Gloudemans
  • 1,201
  • 12
  • 27
0
votes
1 answer

[http]How to identify end of stream when content-length is not specified?

First let me show my code. http=require("http"); fs=require("fs"); var server=http.createServer(function(req,res){ var readStream=fs.createReadStream("1.jpg"); readStream.on("data",function(data){ res.write(data); }); …
AllenLin
  • 170
  • 1
  • 10
0
votes
1 answer

jQuery length property: Which element's length will be returned if there are more than one matched elements?

In the statement var length = $(this).parent().parent().parent().children('tr').length; where $(this).parent().parent().parent() part gives us a element, which happens to have more than one tr children. 1. So which tr among those children…
Solace
  • 8,612
  • 22
  • 95
  • 183
0
votes
1 answer

Xamarin iOS add Content-Length header to HttpClient throws error

I am attempting to use HttpClient to upload a file to Microsoft Azure Blob Storage via their REST api in Xamarin.iOS. It's been going alright until now. Every time I try to add Content-Length header to the client I get this…
0
votes
1 answer

HTTP response content length w gzip

I am making a get request using Python's requests library and streaming the contents into a file. I'd like to add a progress bar by setting the max value of the progress bar to resp.headers['content-length'] and iterating through the response using…
Jeff Tsui
  • 1,266
  • 12
  • 20
0
votes
2 answers

CkEditor : how to get actual text size without HTML tags

How to get text size in CkEditor without all HTML tags? I want to restrict user not to exceed certain text length and want to display correct message with actual length of entered text. CKEDITOR.instances.TextAreId.getData().length returns the…
FaisalKhan
  • 2,406
  • 3
  • 25
  • 32
0
votes
1 answer

JQuery script getting cut off when accessed via reverse proxy

We have a reverse proxy server running on wwwdev.example.com, and we have the full site running on dev.example.com. If I go to dev.example.com/scripts/jquery-version.js, I get the full jQuery-version.js file returned, ending like this: if ( typeof…
zimdanen
  • 5,508
  • 7
  • 44
  • 89
0
votes
1 answer

Node.JS request data length is smaller than given in Content-Length

My request is a multipart/form-data This is how I read the request data: var data = ""; this.request.on( "data" , function( chunk ){ data += chunk; } ); this.request.on( "end" , function(){ this.request.body = this.parseRequest( data…
Michael Sazonov
  • 1,531
  • 11
  • 21
0
votes
1 answer

Get the size of an AJAX response before it finishes loading

I'm using jQuery to load data via AJAX from a server, it's a fairly normal use case. The trick is that I'd like to get the expected content length from the request before it is completed; I want to be able to show a progress bar as the data is…
Leah Sapan
  • 3,621
  • 7
  • 33
  • 57
0
votes
1 answer

PHP Curl sending content-length in header not working

I'm using Curl to upload photos to an actual site. I can see from Fiddler that the headers look like this: Host: test.example.com Proxy-Connection: keep-alive Data-Type: json Accept-Encoding: gzip, deflate Content-Length: 62601 Content-Type:…
user2029890
  • 2,493
  • 6
  • 34
  • 65
0
votes
1 answer

Android Http ContentLength always -1

I need a method that determines the size of a file on the Internet. This is my method: private int getSize(String url){ try { HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection(); …
AxxG
  • 206
  • 3
  • 11