forum POST method content-lenght

Red Squirrel

No Lifer
May 24, 2003
70,671
13,835
126
www.anyf.ca
I'm writting a bot that can post topics, reply etc on IB forums and I'm just wondering what the content-lenght: parameter of the POST method is depending on for the number. I took a packet sniffer log and I could not come with a match for the lenght shown. I'm not sure if it's based on just the data sent, the packet etc... Both forums I'm admin on are on the same server and we are having SQL problems because of the host, but we want to see if it might be our database, so we will be putting up a test forum, so I'm writting a bot to mass post. The only thing I'm confused about is exactly that: the content lenght. I always get bad request errors when I put a random number (but it does actually make the post, but there's data missing). Thanks
 

Buddha Bart

Diamond Member
Oct 11, 1999
3,064
0
0
http://www.w3.org/Protocols/rfc2068/rfc2068

14.14 Content-Length

The Content-Length entity-header field indicates the size of the
message-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.

Content-Length = "Content-Length" ":" 1*DIGIT

An example is

Content-Length: 3495

Applications SHOULD use this field to indicate the size of the
message-body to be transferred, regardless of the media type of the
entity. It must be possible for the recipient to reliably determine
the end of HTTP/1.1 requests containing an entity-body, e.g., because
the request has a valid Content-Length field, uses Transfer-Encoding:
chunked or a multipart body.

Any Content-Length greater than or equal to zero is a valid value.
Section 4.4 describes how to determine the length of a message-body
if a Content-Length is not given.

Not sure if that helps, but hopefully its at least a lead.
 

Red Squirrel

No Lifer
May 24, 2003
70,671
13,835
126
www.anyf.ca
Still unsure, does not seem to tell exactly what it's based on. Once I get this I should get it to work.

Also, what is the content boundery? Is it something the server speficies or is it something the browser speficies, just based on a random number?

Content-Type: multipart/form-data; boundary=---------------------------265001916915724


Thanks in advance