Questions tagged [http-content-length]

The Content-Length header specifies the length (in bytes) of the content, both for requests and responses.

The Content-Length header specifies the length (in bytes) of the content, both for requests and responses. It is especially important when using persistent connections, so the end of one message and the start of the next can be delineated. It is not used for chunked content.

118 questions
0
votes
1 answer

Alamofire download file with progress issue

I want to download a file from server with progress. Here is the code I've tried: let destination: (NSURL, NSHTTPURLResponse) -> (NSURL) = { (temporaryURL, response) in if let directoryURL =…
mkz
  • 2,302
  • 2
  • 30
  • 43
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
0 answers

How to send gzipped data NOT chunked encoded but with content-length header in express? (node.js)

I have something like: var app = require('express')(); var compression = require('compression'); app.use(compression()); app.get('/', function(request, response) { response.send('.......'); } app.listen(2345); The problem is that…
Core_dumped
  • 1,571
  • 4
  • 16
  • 34
0
votes
1 answer

Facing issue while passing parameter list with HttpContent

I am trying to pass a class with a property having a list to Restful service via Post method using HTTPContent. Here is my Controller Code: protected async Task GetOfflineReport(ReportSettings rSettings) { string postUrl…
AMDI
  • 895
  • 2
  • 17
  • 40
0
votes
2 answers

Web file image/video header

In C#, is it possible to detect if the web address of a file is an image, or a video? Is there such a header value for this? I have the following code that gets the filesize of a web file: System.Net.WebRequest req =…
Simon
  • 7,991
  • 21
  • 83
  • 163
0
votes
0 answers

Files from web server return different Content-Encoding and Content-Length values

In our VB6 application, we are using vbmhwb.dll and downloading a file over the web. The files get downloaded properly, but it returns different values of Content-Length. I discovered that the HTTP headers had different Content-Encoding. Below are…
IT researcher
  • 3,274
  • 17
  • 79
  • 143
0
votes
3 answers

Http POST packet and Content-Length field issue

i need to write a full http request packet with POST method. POST require Content-Length field to be accepted, but i don't know packet size until i've write it all. Can i add Content-Length field at the end of http request? and Content-Length field…
giozh
  • 9,868
  • 30
  • 102
  • 183
0
votes
1 answer

2 servlets, one gets a Content-Length in the response, one doesn't

I have 2 different servlets, both are handling POST calls, both stream a file as the result. One always ends up with a Content-Length header, the other never does. They both use javax.servlet.http.HttpServletResponse. Both set "Content-Type" =…
CasaDelGato
  • 1,263
  • 1
  • 12
  • 29
0
votes
1 answer

getting a responseLength for a HttpWebRequest upload from another webfile to stream into the upload when the source doesn't implement ContentLength?

Background - I'm trying to stream an existing webpage to a separate web application, using HttpWebRequest/HttpWebResponse in C#. One issue I'm striking is that I'm trying to set the file upload request content-length using the file download's…
Greg
  • 34,042
  • 79
  • 253
  • 454
0
votes
1 answer

Proxy / gateway behaviour if HTTP response data exceeds content length

How should proxies / gateways behave when http servers send HTTP response where the data size exceeds content-length? Dropping it as a RFC non-compliance is one way to go but looks like there are quite a few implementations/deployments with this…
0
votes
1 answer

Send a Response with an inexact Content-Length header then manually end it

I'm in a situation where I'm sending a file to an MP3 player, and this player needs to know the file length to show progress bar properly. The problem is that this MP3 comes from a file that is the result of an on-the-fly conversion, so I cannot…
Léon Pelletier
  • 2,701
  • 2
  • 40
  • 67
-1
votes
2 answers

Content length is not found in this URL

String thisurl ="http://songolum.com/file/ppdVkTxqhwcJu-CAzCgtNeICMi8mHZnKQBgnksb5o2Q/Ed%2BSheeran%2B-%2BPerfect.mp3?r=idz&dl=311&ref=ed-sheran-perfect"; url = null; try { url = new URL(thisurl); HttpURLConnection urlConnection =…
user2037091
  • 57
  • 1
  • 2
  • 8
-2
votes
3 answers

How to get a file size in Bytes or in MB's through a URL

I am new to Java.. I was trying to get the file size from a URL but I failed can any one help me how to get the URL size in bytes?
bro1o1
  • 37
  • 2
  • 9
1 2 3 4 5 6 7
8