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

Extending SoapHttpClientProtocol to correct faulty server Content-Length

Recently I got the need to access a web service created using SOAP::Lite. It's really messy to use since there's no WSDL, it doesn't return reasonable datatypes etc. so I started out using the provided sample code. Right from the start I got…
5
votes
2 answers

ColdFusion - how to set Content-Length header

Has anyone successfully added a Content-Length header to regular ColdFusion (I'm using CF9) pages? I'm setting up a new server behind a Cisco load balancer with compression - the box refuses to compress anything without this header, but CF doesn't…
Geoff
  • 51
  • 1
  • 2
5
votes
0 answers

Guzzle response with content-encoding: gzip comes back with incorrect content-length header

I have a symfony2 application where I am using the Guzzle http client to send a GET request to a server in order to retrieve the contents of a json file. The Guzzle response gets transformed into a Symfony2 response to the browser. The Guzzle…
ShasOKais
  • 53
  • 7
5
votes
1 answer

Using Tomcat or Spring to check if content-length header is set correctly in request

In broader context, we would like to limit the size of a messages a client can send to the server by http post request. I would like to do this by using http header content-length. So I don't have to read the full body, just check this header, and…
csviri
  • 1,159
  • 3
  • 16
  • 31
5
votes
5 answers

How to get the size of an InputStream?

I'm having an InputStream from a ProcessBuilder that acutally reads the stdout stream. Question: how can I know the size of that inmemory InputStream, so I can write it to a HttpResponse http header? InputStream is =…
membersound
  • 81,582
  • 193
  • 585
  • 1,120
5
votes
1 answer

why C# queue or list only has count but array has length?

This maybe a silly question, why there is no Length property for queue or list, but only Count? And similarly why there is Length property for array? Thanks
spspli
  • 3,128
  • 11
  • 48
  • 75
5
votes
2 answers

Get Size of HTTP Response in Java

I would like to know how much data was sent in response to a certain http-request. What I currently do is this: HttpURLConnection con = (HttpURLConnection) feedurl.openConnection(); //check the response for the content-size int feedsize =…
er4z0r
  • 4,711
  • 8
  • 42
  • 62
5
votes
3 answers

Get number of elements in a JQuery Sortable list

The API of JQuery Sortable isn't clear on how to retrieve the number of elements in a sortable list. The reason I want the number of elements, is because I want to set the position of a widget to the end of the sortable list. I know there is an…
John Hendrik
  • 661
  • 1
  • 7
  • 20
4
votes
2 answers

How to make JAXWS send content-length header on SOAP responses

Basically I made a Webservice using JAXWS. It uses SOAP and works. However on some request some clients crash/error, it seems to be linked to the fact the JAXWS webservice does not send the content-length header. Is there a way to add it? Using:…
Neck
  • 43
  • 1
  • 3
4
votes
1 answer

Long page receiving time reported by Firebug net tab (page loading slow)

I am experiencing a problem where a page appears to be taking around 8s to load for no apparent reason. As you can see in this screenshot, all the resources on the page load well before 8s and the large majority of the loading time is reported in…
4
votes
1 answer

Does Apache HttpClient (4.5) support chunked data?

I have a simple method to send a POST request: public HttpResponse post(InputStream content, String contentType, URI url) { InputStreamEntity entity = new InputStreamEntity(content); entity.setChunked(true); …
Pleymor
  • 2,611
  • 1
  • 32
  • 44
4
votes
1 answer

ERR_CONTENT_LENGTH_MISMATCH when loading video in chrome

So I get this error when some of the video plays. When Chrome completely downloads the video, it stops playing with this error. Also the status of the request changes from 206 to (failed) and then Chrome sends some other requests with…
4
votes
1 answer

Linux cURL vs PHP cURL - POST Request

I have to upload a ZIP file using HTTPS and this is working only via Linux cURL command. I don't understand what i am missing in PHP cURL request... Linux cURL [working]: curl -v -x http://api.test.sandbox.mobile.de:8080 -u USER:PASS -X POST…
Mirela
  • 41
  • 4
4
votes
1 answer

Cloudflare Content Type

I have just started to use CloudFlare and have run into an issue with it's CDN service. I want my script to send back a the Content-Type header. I have tried to use page rules but doesn't help one bit. I just want to get the content length! PHP…
user3732111
  • 151
  • 1
  • 2
  • 8
4
votes
2 answers

Content-Length header is not set in Golang http client request using PUT method

I'm using Golang 1.4.2 (built from source) and when I try to make an HTTP PUT request via http.Client.Do() the Content-Length header is missing from the request. All my other headers are sent... Am I doing something wrong? When I make the same…
Austen Hoogen
  • 2,726
  • 3
  • 18
  • 12
1 2
3
24 25