Index: bbnet/httptest.c =================================================================== --- bbnet/httptest.c (revision 6161) +++ bbnet/httptest.c (working copy) @@ -590,11 +590,17 @@ addtobuffer(httprequest, "\r\n"); if (httptest->bburl.postdata) { - char contlenhdr[100]; + char hdr[100]; + int contlen = strlen(httptest->bburl.postdata); - sprintf(contlenhdr, "Content-Length: %d\r\n", strlen(httptest->bburl.postdata)); - addtobuffer(httprequest, contlenhdr); - addtobuffer(httprequest, "Content-Type: application/x-www-form-urlencoded\r\n"); + addtobuffer(httprequest, "Content-Type: "); + if (httptest->bburl.postcontenttype) + addtobuffer(httprequest, httptest->bburl.postcontenttype); + else + addtobuffer(httprequest, "application/x-www-form-urlencoded"); + addtobuffer(httprequest, "\r\n"); + sprintf(hdr, "Content-Length: %d\r\n", contlen); + addtobuffer(httprequest, hdr); } { char useragent[100];