rewrite tests: improve POST test, only add header if not empty