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
12
votes
4 answers

How to set Content-Length when sending POST request in NodeJS?

var https = require('https'); var p = '/api/username/FA/AA?ZOHO_ACTION=EXPORT&ZOHO_OUTPUT_FORMAT=JSON&ZOHO_ERROR_FORMAT=JSON&ZOHO_API_KEY=dummy1234&ticket=dummy9876&ZOHO_API_VERSION=1.0'; var https = require('https'); var options = { …
ekanna
  • 5,462
  • 8
  • 28
  • 31
12
votes
1 answer

Getting "411 Length Required" after a PUT request from HTTP Client

I am working on a Java program that implements an HTTP Client. I test it sending requests to a server. GET, POST and DELETE requests work ok. For example after a POST request I get an output Data extracted: {"status":{"message":"ok"}} and the…
Limbo Exile
  • 1,321
  • 2
  • 21
  • 41
11
votes
2 answers

How do I get the content length of a Django response object?

In Django, I try to logging the request and response content length, which exactly the same as what Django server prints to stderr. [05/Apr/2011 22:59:08] "GET /pages/ HTTP/1.1" 200 332161 [05/Apr/2011 22:59:15] "GET /pages/12 HTTP/1.1" 301…
William
  • 239
  • 1
  • 2
  • 11
10
votes
12 answers

How to check for incomplete POST request in PHP

I am facing a problem when a remote web client with slow connection fails to send complete POST request with multipart/form-data content but PHP still uses partially received data to populate $_POST array. As a result one value in $_POST array can…
spatar
  • 550
  • 1
  • 5
  • 15
9
votes
1 answer

What are the consequences of not including a content-length header in a server response?

The RFC says the content-length header is optional ("..Applications SHOULD use this field..."). From what I can gather if its not included then the client will not know how much data to expect, therefore will not be able to show a determinate…
Robert
  • 37,670
  • 37
  • 171
  • 213
8
votes
1 answer

Problem with bash readarray -t array assignment when jq outputs an empty string

First - a very simple code: #!/bin/bash a_string="string" readarray -t a <<<"$a_string" echo "${a[@]}" echo "${#a[@]}" # read empty string into array emptystring="" readarray -t b <<<"$emptystring" echo "${b[@]}" echo "${#b[@]}" # and now - empty…
Invisible999
  • 547
  • 2
  • 5
  • 16
8
votes
1 answer

IIS 7.5 ASP.NET HttpModule - Setting Response.Filter results in chunked encoding

I'm trying to create a HttpModule that changes the Response.Filter like so (for this demonstration just set the filter back to itself): public class ContentTrafficMonitor : IHttpModule { public void Init( HttpApplication context ) { …
Evan
  • 5,925
  • 6
  • 33
  • 35
8
votes
1 answer

Is it possible to set blob download sizes in GAE apps now that the Content-Length header is disallowed?

After the AppEngine API update that came out a few weeks ago, the wonderful "Disallowed HTTP Response Headers" section appeared in the Python Response class documentation here, which explains that the listed headers cannot be set for security…
8
votes
3 answers

IIS7 - Specifying content-length header in ASP causes "connection reset" error

I'm migrating a series of websites from an existing IIS5 server to a brand new IIS7 web server. One of the pages pulls a data file from a blob in the database and serves it to the end user: Response.ContentType =…
MisterZimbu
  • 2,673
  • 3
  • 27
  • 28
7
votes
2 answers

Axios: Content-Length header is missing on request headers

we are facing an issue in production that the 'Content-Length' header is not being sent, even if we hard-code it in the headers properties, so we are receiving back from the server the 411 Length Required error. We are using: Axios 0.16.2 NodeJS…
thiago
  • 123
  • 1
  • 3
  • 10
7
votes
1 answer

When does Rails respond with 'transfer-encoding' vs. 'content-length'?

I'm building an API on Rails version 4.1.7/Nginx that responds to request from an iOS app. We're seeing some weird caching on the client and we think it has something to do with a small difference in the response that Rails is sending back. My…
readyornot
  • 2,783
  • 2
  • 19
  • 31
6
votes
3 answers

how to select Columns using SQL which has data length greater than given length

I have a table with specific columns and rows. I would like to select columns which has data more than length 7. For ex: Table has columns Name Address PhoneNumber AAA AAAAAAAA 12345678 BBBBB BBBBBBB 47854 CCC FFFF …
Sujatha Rajesh
  • 79
  • 1
  • 2
  • 8
6
votes
1 answer

Alamofire request is missing "Content-length"

The request I am getting on server side is missing the content-length of each multipart. I tried to change the headers but it still won't display. I am successfully sending image file and some data from device/simulator to server using Alamofire/…
user9039131
6
votes
6 answers

CSS - Indent all except first line

Update 2013-01-04 The flexbox solution makes very little extra HTML / CSS. However it's unclear if it can work in Firefox and IE10? To add minus characters to :before with CSS content instead of HTML is a better way to go. Information I have a…
Jens Törnell
  • 23,180
  • 45
  • 124
  • 206
5
votes
2 answers

content-length header from php is overwritten !

I'm trying to figure why the Content-Length header of php gets overwritten. This is demo.php a request to fetch the headers curl -I http://someserver.com/demo.php HTTP/1.1 200 OK Date: Tue, 19 Jul…
Michael
  • 51
  • 2
1
2
3
24 25