Add content-length for put and post methods……

The nginx requires the http method with content-length in header, so I add content-length for
put and post methods to support nginx.