If you use send_request_cgi(), you don't need to set the content-length header, it's done automatically.