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

IMAP command to get size of message

I am looking for the best way to get the sizes of messages using IMAP(i am writing a simple c# lib for myself). Basically a POP3 STAT command equivalent would be good, but it does not exist. I am thinking of fetching the message header and getting…
Alex
  • 127
  • 2
  • 12
2
votes
0 answers

C# - StreamReader incompatible with Content-Length?

I receive a JSON from an http stream I rely on the Content-Length header to read the body, but the StreamReaders reads extra characters is it possible to use the Content-Length value of the header as-is while using a StreamReader ? with this…
2
votes
0 answers

Linux or WSL2 does not make requests with large BODY

My setup, I have a Win11 machine with WSL2 running docker, I have a container of my Laravel application that when making HTTP requests if the body is too big, it gives an error, but the error is generic, it doesn't say it's the size, see: Laravel…
Dhenyson Jhean
  • 634
  • 6
  • 14
2
votes
1 answer

Custom CMS written in PHP, should I be sending HTTP content-length header to clients?

I've built a custom content management system on our intranet which allows us to update news articles and content across several sites that I operate. It appears to be working well. However the other day I suddenly remembered that I'm not sending…
batfastad
  • 1,943
  • 3
  • 27
  • 37
2
votes
0 answers

Vaadin Audio player, seek not working - chunked response

i am working on my gwt prj, i have added the Vaadin audio player for mp3 file. The issue is that on Chrome, the seek bar of the audio sometimes don't work. My code is: StreamResource resource = new StreamResource(this, filename); Audio audio = new…
monotor
  • 107
  • 5
2
votes
0 answers

How do curl and wget deal with a reponse without the content-length header?

I run the following http echo server. In its response, it does not have the Content-Length header. $ http-echo-server 3005 https://www.npmjs.com/package/http-echo-server When I run curl, I see this. It waits at "mydata" a short period of time, then…
user15502206
2
votes
1 answer

Input field executing Javascript event multiple times

Javascript noob here. A bit stuck with respect to a mfa input field verification I'm trying to implement for my web app. Instead of having the user hit the "Submit" button after they enter an mfa code in the input field, I want to simply fire my…
Parker
  • 225
  • 3
  • 11
2
votes
0 answers

HTTP POST REQUEST C++

I have been stuck on a small piece of code trying it out. char httpRequest[] = "POST http://myhost.com/ HTTP/1.1\r\n" "Host: myhost.com\r\n" "Content-Type: application/x-www-form-urlencoded\r\n" …
2
votes
3 answers

How to validate content length of multipart form data in JavaScript?

I post FormData (including files) to a server that rejects requests with a content-length that exceeds a specific limit. I'd like to validate the content-length in my JavaScript client (browser) before doing a request that is doomed to be rejected.…
2
votes
2 answers

Get file size before download without using Content-Length header

I want to get the file size before I download it, In my code I'm extracting the Content-Length header from the request. My code works fine for a lot of cases, but in some cases there is no Content-Length header, my question is how can I get the file…
spez
  • 409
  • 8
  • 21
2
votes
0 answers

Same Image URL's returning either 24 bit or 32 bit Image on Cloudfare Server? (cURL "content-length" check)

This is very confusing to me and I can't seem to find any information anywhere which may explain this. I've a database of around 1,000 image URL's and I am doing a cURL header callback curl_setopt($this->curl, CURLOPT_HEADERFUNCTION, array($this,…
Brian Bruman
  • 883
  • 12
  • 28
2
votes
2 answers

Axios set Content-Length manually, nodeJS

Is there a way to send a post request in nodeJS and specify th content-length. I tried (using axios): let data = `Some text data...........`; let form = await Axios.post( "url.......", data, { headers: { …
Shmili Breuer
  • 3,927
  • 2
  • 17
  • 26
2
votes
0 answers

How to detect content length(response size) without receiving response in Nodejs?

I am requesting a rest server from nodejs by using nodejs request module.is it possible to determine the size of the data that will be returned to me (before accepting the data)?I want to cancel the operation if the size of the data that will be…
Baltazarr
  • 35
  • 1
  • 10
2
votes
1 answer

Content-Length header missing for Spring RestTemplate Gzip response

I am using Spring Boot to integrate to a third party which can provide gzipped responses and I want to log the size of the compressed response body vs the decompressed so we can audit for billing etc. I'm using RestTemplate.exchange to make the GET…
Glamdring
  • 69
  • 2
  • 7
2
votes
2 answers

Does compressing HTTP response is useless when Content-Length is lower than 1K?

I wrote a web service that respond JSON content lower than 1K. Which one of this compression strategy is the best? gzip this content by the reverse-proxy as any other text ressource? Add a rule to not compress ressources under a threshold? I think…
BenC
  • 1,647
  • 18
  • 25