Hi there,
In my
servlet I will send data to a URL using method 'POST' with HttpUrlConnection class.
But it happens to return me http code=411 from server which indicates content-length field.
I try to send few data like "userid=username&pass=1234&msg=try+again"
Here is my part of code:
My question is
1: Does content-length field is necessary in a POST method ?
2: Even if I coded "connection.setRequestProperty("Content-length", length) " after connection.setRequestMethod("POST"), It will give me NO return_code value. Why?
Can anyone please help me..i'm stuck for few days..
thanks in advance.
Nick